ResultMetaData and ibatis

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ResultMetaData and ibatis

lewisstrauss
Hi,

advice ....... help me......

In an application that uses iBATIS, at runtime I need to know the column name, 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 FROM TRACKING");
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?


Ciao

Diego (Venice, Italy)
Loading...