阅读背景:

如何从另一个类调用我的连接变量?

来源:互联网 
private static Connection conexion() {
    try {

        //Cargamos el Driver MySQL

        conexion = DriverManager.getConnection(server, user, pass);


     } catch (Exception e) {
         JOptionPane.showMessageDialog(null,"Error "+e);
         System.out.println("SQLException: " + e.getMessage());
         System.out.println("SQLState: " + ((SQLException) e).getSQLState());
         System.out.println("VendorError: " + ((SQLException) e).getErrorCode());
     }
     return conexion;

}
private static Connection conexion() {
    try 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: