1. Trang chủ
  2. » Luận Văn - Báo Cáo

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

91 0 0
Tài liệu được quét OCR, nội dung có thể không chính xác
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 91
Dung lượng 7,78 MB

Nội dung

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 1

package 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 2

package 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 3

package 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 4

package 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 5

package 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 6

package 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 7

package 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 8

package 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 9

package 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 10

package 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 11

package 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 12

package 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 13

package 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 14

package 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 15

package 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 16

package 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 17

package 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 18

package 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 19

package 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 20

package 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 21

package 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 22

package 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 23

package 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 24

package 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 25

package 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 26

package 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 27

package 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 28

package 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 29

package 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 30

package 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 31

package 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 32

package 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 33

package 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 34

package 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 35

package 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 36

package 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 37

package 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 38

package 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 39

package 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 40

package 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; }

Ngày đăng: 29/06/2023, 17:49

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN