java jdbc

1.java 的jdbc类包括,DriverManager,Connection 

Connection con = DriverManager.getConnection("jdbc:odbc:wombat","login",
"password");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) {
int x = rs.getInt("a");
String s = rs.getString("b");
float f = rs.getFloat("c");
}
posted @ 2017-01-03 22:47  跨境电商杂货铺  阅读(153)  评论(1编辑  收藏  举报