Archive for May 2009
Blue night
Today I was searching Amazon, trying to decide the stuff I will buy (I mean what one friend in United States is going to buy for me, I hope)…. it has been a hard decision, current bill is about US$250, it is too much money to pay, the greater amount of things to buy are books, in fact they are four, plus a basic filters lens set, a wide angle lens and a cleaning kit for my camera….I really dont know what to leave for later, I want everything.
Tomorrow is the day to decide, I am going to sleep on it.
Night is closer
A long time, again, I have been very busy, naaa I am getting crazy, I am leading with many responsibilities at the same time, I need to take a breath. Could you imagine how I like it?, jajajaja, I like being busy, keep my mind working all the time, for example tomorrow I have a French exam I have not studied for, when coming back to home I have to open the book and start it, they are too many units I have to study, so it will take a long time to finish that task.
A long time, again, I took to post a new picture, I am taking the bad habit of posting one picture per week, it is not good I will try to correct it.
Towards night
These weeks have been very hard at work, I have been working almost without stopping, there have been too many things to do and all of them at the same time….
Now I feel a bit free, for example, to post a new picture on my blog, ja.
New things has come to my life these days, I am happy (I want to keep them myself).
Life is beautiful.
Make Tomcat 5 to handle wmv (Windows Media Video) files
This week I have uploaded two videos to the website of the institute I work for. There was a problem with Tomcat related to wmv files because it was not recognizing the mime type and users where experiencing problems when trying to download the videos.
I was surfing internet looking for the solution to that problem and I found it:
All what it has to be done is to add a new mime type to the web.xml file (the one inside of Tomcat’s conf directory):
<mime-mapping> <extension>wmv</extension> <mime-type>application/octet-stream</mime-type> </mime-mapping>
It could sound strange but this mime is not correct but that makes it to work for both IE and other browsers.
So edit the file and restart Tomcat, that is all.
Taken from: Visit site
Waiting for you
Happy Birthday Laura
Laura Gabriela, the name of this ship (which could seems small but it is enough strong to move a big cruiser), curiously coincides with the name of two of my cousins which names are Laura and Gabriela, they are sisters.
Laura, the smaller girl of two is celebrating her birthday today and I want to be part of the celebration, so HAPPY BIRTHDAY my little beautiful cousin, God bless you. Though you are not a very talkative girl I can found pieces of your love in small things you say and do when I am close. So I send you many hugs and kisses in this special day.
Enchantment of the seas
…and this is what had beign held that day by that anchor.
Would you like to have a seafront on it?
Hold it tight
Clobs in Oracle 10g
CLOB is the Oracle’s data type used for storing large textual data objects.
There is a problem when using standar APIs for processing CLOB data, it is that PreparedStatement.setString() only allows to process strings up to 32765 byte. To solve it, Oracle 10g has introduced a new property called SetBigStringTryClob that allows developers to use the standar JDBC PreparedStatement.setString() and ResultSet.getString() functions for also processing CLOB data.
Next snippet shows how to achieve CLOB handling by setting new property when creating the connection:
import java.sql.Connection;
import java.sql.DriverManager;
import oracle.jdbc.OracleDriver;
import java.util.Properties;
..........
// Load the database details into the variables.
String url = "jdbc:oracle:thin:@localhost:1521:orcl";
String user = "scott";
String password = "tiger";
// Create the properties object that holds all database details
Properties props = new Properties();
props.put("user", user );
props.put("password", password);
props.put("SetBigStringTryClob", "true");
// Load the Oracle JDBC driver class.
DriverManager.registerDriver(new OracleDriver());
// Get the database connection
Connection conn = DriverManager.getConnection( this.url, this.props );
This new property forces the preparedStatement.setString() to use another newly introduced method, OraclePreparedStatement.setStringForClob(), which can be used alone instead of the standar APIs. See how:
import java.sql.*;
import java.io.*;
import java.util.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.*;
..........
// Create SQL query to insert CLOB data and other columns in the database.
String sql = "INSERT INTO clob_tab VALUES(?)";
// Read a big file(larger than 32765 bytes).
// Note: method readFile() not listed here.
// It can be any method that reads a file.
String str = this.readFile("bigFile.txt");
// Create the OraclePreparedStatement object
opstmt = (OraclePreparedStatement)conn.prepareStatement(sql);
// Use the new method to insert the CLOB data (for data greater or lesser than 32 KB)
opstmt.setStringForClob(1,str);
// Execute the OraclePreparedStatement
opstmt.executeUpdate();
...........
Taken from: Handling Clobs in Oracle 10g
I am Victor Santafé, a 24 years old guy currently living and working in Colombia. I am a System Engineer, I love my profession, I love everything about Software Engineering and Programming Languages, I love music, photography and everything related to arts.






