|
|
|
@ -56,9 +56,9 @@ public class NewReadFrmFromDatabase extends DBFormlet {
|
|
|
|
|
private static Connection getConnection() throws ClassNotFoundException, SQLException { |
|
|
|
|
// 定义数据连接(根据你实际数据库信息进行修改)
|
|
|
|
|
String driver = "com.mysql.jdbc.Driver"; |
|
|
|
|
String url = "jdbc:mysql://localhost:3306/frtest"; |
|
|
|
|
String url = "jdbc:mysql://localhost:3306/test"; |
|
|
|
|
String user = "root"; |
|
|
|
|
String pass = "root"; |
|
|
|
|
String pass = "123456"; |
|
|
|
|
Class.forName(driver); |
|
|
|
|
Connection conn = DriverManager.getConnection(url, user, pass); |
|
|
|
|
return conn; |
|
|
|
|