Khóa luận tốt nghiệp Quản trị kinh doanh: Phân tích tình hình tài chính tại Công ty TNHH SXTM Tân Hưng được thực hiện với mục tiêu nhằm phân tích tình hình tài chính của công ty thông qua báo cáo tài chính; đánh giá tình hình tài chính của công ty thông qua các chỉ số tài chính. Từ đó, đưa ra một số giải pháp nhằm nâng cao hiệu quả hoạt động 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 2package 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 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 4package 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 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 6package 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 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 8package 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 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 10package 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 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 12package 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 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 14package 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 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 16package 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 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 18package 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 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 20package 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 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 22package 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 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 24package 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 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 26package 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 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 28package 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 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 30package 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 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 32package 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 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 34package 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 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 36package 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 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;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 38package 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 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 40package 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; }