Class.forName(GlobalConstants.DB_DRIVER);
Connection conn = DriverManager.getConnection(GlobalConstants.DB_URL,GlobalConstants.DB_USER,GlobalConstants.DB_PWD);
String sql = "SELECT DISTINCT location FROM servicedoffices ORDER BY location";
PreparedStatement stmt = conn.prepareStatement(sql);
ResultSet rs = stmt.executeQuery();
Vector locationList = new Vector();
while(rs.next()){
locationList.add(rs.getString("location"));
locationList.add(rs.setTimestamp("Time"));
}
rs.close();
stmt.close();
conn.close();
2022年5月20日 星期五
Java call SQL
0Posted on 下午4:23 by 亞爾文俊
0 意見:
張貼留言