kurent
06-02-2009, 03:29 AM
We do a database query:
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
ds = (javax.sql.DataSource) ctx.lookup("jdbc/DB1");
// ...
con = ds.getConnection("username", "password");
con.setAutoCommit(false);
stmt = con.createStatement();
// ...
rs = stmt.executeQuery("SELECT SOMETHING FROM TABLE WHERE ...");
Now how to get the SQL code returned from the database?
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
ds = (javax.sql.DataSource) ctx.lookup("jdbc/DB1");
// ...
con = ds.getConnection("username", "password");
con.setAutoCommit(false);
stmt = con.createStatement();
// ...
rs = stmt.executeQuery("SELECT SOMETHING FROM TABLE WHERE ...");
Now how to get the SQL code returned from the database?