Revert "Revert "1. DB 연결 관련 Dao, Vo 자바 파일 생성""
This reverts commit 9bc7963d4c.
This commit is contained in:
28
hospital/src/main/java/DB/BasicDao.java
Normal file
28
hospital/src/main/java/DB/BasicDao.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package DB;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class BasicDao {
|
||||
private String driver = "com.mysql.jdbc.Driver";
|
||||
private String url = "jdbc:mysql://@110.35.119.108:3307:hospital_DB";
|
||||
private String user = "mes";
|
||||
private String password = "Mestkdrhdghldmlth1!";
|
||||
protected Connection conn;
|
||||
protected PreparedStatement psmt;
|
||||
protected ResultSet rs;
|
||||
|
||||
public BasicDao() {
|
||||
try {
|
||||
Class.forName(this.driver);
|
||||
this.conn = DriverManager.getConnection(this.url, this.user, this.password);
|
||||
|
||||
} catch (SQLException | ClassNotFoundException var2) {
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user