Khóa luận tốt nghiệp Tài chính Ngân hàng: Phân tích hoạt động kinh doanh tại Agribank chi nhánh huyện Vĩnh Thuận, tỉnh Kiên Giang giai đoạn 20102012 được thực hiện với mục tiêu nhằm phân tích hoạt động kinh doanh tại Agribank chi nhánh huyện Vĩnh Thuận, tỉnh Kiên Giang trong giai đoạn 20102012 để có những giải pháp nhằm giúp hoạt động kinh doanh sắp... Đề tài Hoàn thiện công tác quản trị nhân sự tại Công ty TNHH Mộc Khải Tuyên được nghiên cứu nhằm giúp công ty TNHH Mộc Khải Tuyên làm rõ được thực trạng công tác quản trị nhân sự trong công ty như thế nào từ đó đề ra các giải pháp giúp công ty hoàn thiện công tác quản trị nhân sự tốt hơn trong thời gian tới.
Trang 1package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 2public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 3package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 4public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 5package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 6public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 7package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 8public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 9package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 10public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 11package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 12public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 13package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 14public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 15package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 16public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 17package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 18public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 19package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 20public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 21package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 22public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 23package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 24public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 25package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 26public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 27package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 28public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 29package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 30public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
}
public void disconnect() { if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 31package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 32public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 33package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 34public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 35package connectDB; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 36public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 37package connectDB; import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectDB {
public static Connection con = null;
private static ConnectDB instance = new ConnectDB();
public static ConnectDB getInstance() {
return instance;
}
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;databasename=Q
LNVIEN";
String user = "sa";
String pw = "123";
con = DriverManager.getConnection(url, user, pw);
if(con != null) {
System.out.println("thanh cong");
}
}
public void disconnect() {
if(con != null) {
try {
con.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}
public static Connection getConnection() {
return con;
}
Trang 38public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() {
return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }
Trang 39package connectDB;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectDB {
public static Connection con = null;
private static ConnectDB instance = new ConnectDB();
public static ConnectDB getInstance() {
return instance;
}
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;databasename=Q
LNVIEN";
String user = "sa";
String pw = "123";
con = DriverManager.getConnection(url, user, pw);
if(con != null) {
System.out.println("thanh cong");
}
}
public void disconnect() {
if(con != null) {
try {
con.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}
public static Connection getConnection() {
return con;
}
Trang 40public class ConnectDB {
public static Connection con = null; private static ConnectDB instance = new ConnectDB(); public static ConnectDB getInstance() { return instance; }
public void connect() throws SQLException {
String url = "jdbc:sqlserver://localhost:1433;database name=QLNVIEN"; String user = "sa"; String pw = "123"; con = DriverManager.getConnection(url, user, pw); if(con != null) {
System.out.println("thanh cong"); }
} public void disconnect() {
if(con != null) { try {
con.close(); } catch (Exception e) {
// TODO: handle exception e.printStackTrace(); }
} }
public static Connection getConnection() { return con; }