| Main | Quick Start | User Guide | JavaDoc | News | Download | Contact |
|---|---|---|---|---|---|---|
|
Why write this?
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:wombat", "myLogin","myPassword");
PreparedStatement stmt = con.prepareStatement("SELECT a FROM Table1 WHERE b = ?");
stmt.setInt(1,1);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
int x = rs.getInt("a");
}
rs.close();
stmt.close();
con.close();
When you could write this?
... and get built-in connection configuration, pooling, and logging?
Select select = new Select("SELECT a FROM Table1 WHERE b = ?").setArgs(1).execute();
while (select.next()) {
int x = select.getInt("a");
}
select.close();
|
||||||
|
© 2007 buzzsurf.com. All Rights Reserved. http://www.buzzsurf.com |