30 lines
875 B
Java
30 lines
875 B
Java
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 = "org.mariadb.jdbc.Driver";
|
|
//private String url = "jdbc:mysql://@110.35.119.108:3307:hospital_DB";
|
|
private String url="jdbc:mariadb://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();
|
|
}
|
|
|
|
}
|
|
}
|