java概念 -- JDBC
时间:2021-07-01 10:21:17
帮助过:4人阅读
Connection con = DriverManager.getConnection("jdbc:odbc:wombat","login"
,
2 "password"
);
3 Statement stmt =
con.createStatement();
4 ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1"
);
5 while (rs.next()) {
6 int x = rs.getInt("a"
);
7 String s = rs.getString("b"
);
8 float f = rs.getFloat("c"
);
9 }
上述代码对基于JDBC的数据库访问做了经典的总结。
java概念 -- JDBC
标签:java语言 访问 发送 rmi 不同 set state java sel