This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, can anybody tell me what will ResultSetMetaData.getColumnType(int column) returns. It returns an integer, what is that integer. For eg. for column type Varchar2 it returned 12. Thanks Neha
You should not rely on the actual int value but on the constants defined in java.sql.Types [This message has been edited by JUNILU LACAR (edited August 23, 2001).]
Hi Junilu, Could you explain further, I didn't understand what is the interger type of column type. I mean if it is string what it should return, if it is 'Date' type what should this method return. Thanks Neha
Check out the static constants that are defined in the class java.sql.Types. One of these static integer constants is what is returned by getColumnType(int c). hope this clarifies...
Ivor Horton's chapter of his Beginning Java book, on JDBC is on the web, I think at the Sun site. He explains this very well. It's in PDF, or I would paste an excerpt here. "The Types class in the java.sql package defines public fields of type int that identify the SQL types, and the names of these class data memebers are the same as the SQL types they represent -- such as CHAR,VARCHAR, DOUBLE..."
------------------
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: returning value of ResultSetMetaData.getColumnType(int column)