This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
The data is normally printed...... but the exception is throwed any way.
Extra iformation: sun.jdbc.odbc.JdbcOdbcDriver MySQL 5 JDK 1.5
Doe�s somebody can help?
Thank�s in advance, Rafael.
Thanks,
Rafa
Vallidevi Appana
Greenhorn
Joined: Jun 30, 2006
Posts: 25
posted
0
Hi
Try this out.....
while (rs.next()) {
ResultSetMetaData meta = rs.getMetaData(); int count = meta.getColumnCount(); Map elemento = new HashMap();
for (int i = 0; i < count; i++) { Object o = rs.getObject(i + 1);
if (o == null) {
o = "";
}
Problem might be calling getObject twice....
stu derby
Ranch Hand
Joined: Dec 15, 2005
Posts: 333
posted
0
Extra iformation: sun.jdbc.odbc.JdbcOdbcDriver MySQL 5 JDK 1.5
I think the other poster is correct, that the 2nd call to getObject for the same column is the problem. Some drivers allow that and some don't (the JDBC allows this difference).
In particular, I think the native MySQL driver will allow it and the JDBC-ODBC bridge that you're using won't.
Rafael Fagundes
Ranch Hand
Joined: Sep 23, 2004
Posts: 52
posted
0
Thank�s Vallidevi. You was completle write. Stu derby, you are write also. On the first version of the application, I was using the native MySQL driver. There was no problem with the posted code. When I changed de driver for sun.jdbc.odbc.JdbcOdbcDriver, this problem started to happen (not because it�s a bad driver, off course; it simply dosen�t support what I was trying to do).