resultsetmetadata and ibatis

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

resultsetmetadata and ibatis

lewisstrauss
Hi,  
advice ....... help me......  
In an application that uses iBATIS, at runtime
 I need to know the columnname, type and size .....  

Using jdbc classic can do so:
String driver = "oracle.jdbc.driver.OracleDriver";Class.forName(driver);
String url = "...................................................";
Connection con = DriverManager.getConnection (url, "....", "....");
Statement stmt = con.createStatement ();
ResultSet rs = stmt.executeQuery("SELECT Column1, Column2, Column3 FROMTRACKING");
ResultSetMetaData rsmd = rs.getMetaData();
for(int i = 1; i < 4; i++)
{System.out.println("rsmd.getColumnName: " + rsmd.getColumnName(i));
System.out.println("rsmd.getColumnType: " + rsmd.getColumnType(i));
System.out.println("rsmd.getPrecision: " + rsmd.getPrecision(i));
}
res.close();
stmt.close();
con.close();}  

 Is there a way to do the same thing with iBATIS?Does anyone have a piece of sample code?  

Hi Diego (Venice, Italy)
Reply | Threaded
Open this post in threaded view
|

Re: resultsetmetadata and ibatis

MK4UIBATIS
Hi,

I need to get resultSet or resultSetMetadata from Ibatis query result. Is there any way to get it done?

Thank you,
MK


lewisstrauss wrote
Hi,  
.....
{System.out.println("rsmd.getColumnName: " + rsmd.getColumnName(i));
System.out.println("rsmd.getColumnType: " + rsmd.getColumnType(i));
System.out.println("rsmd.getPrecision: " + rsmd.getPrecision(i));
}

 Is there a way to do the same thing with iBATIS?Does anyone have a piece of sample code?