1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
   |  
 
package Test;
 
import java.beans.*;
import java.sql.*;
import java.awt.*;
import java.sql.*;
import java.util.*;
import javax.swing.JLabel;
import com.mysql.jdbc.Statement;
import com.mysql.jdbc.Connection;
 
public class GestionConnectBdD {
 
    static String url; //10.104.100.57
    static ResultSet rs;
 
    public static void Connection(JLabel res, JLabel auto, String User, String Pass, String IP, String Port, String Nom) throws ClassNotFoundException, SQLException {
 
        Connection conn;
        Statement stmt;
 
        String pilote = "org.gjt.mm.mysql.Driver";
 
 
 
        Class.forName(pilote);
 
        conn = (Connection) DriverManager.getConnection(url);
 
        stmt = (Statement) conn.createStatement();
 
 
 
    }
 
    public static void Deconnection() {
        rs = GestionConnectBdD.rs;
        rs.close();
        stmt.close();
        conn.close()
 
    }
} | 
Partager