sql >> Base de Datos >  >> RDS >> Mysql

SQLNonTransientConnectionException Conexión con MySQL en Eclipse

Prueba esto:

// None of this belongs in a main method. 
public static void main(String[] args) throws Exception {
    Class.forName("com.mysql.jdbc.Driver");     
    // where are url, user, pass set?  I don't see them.   
    Connection conn = DriverManager.getConnection(url, user, pass);
    Statement stmt = conn.createStatement();
    // this is simply wrong.
    String mysql1 = "UPDATE Policy SET " + readAndArray("filepath");
}

Eres nuevo en Java y JDBC. Esta no es una buena manera de hacerlo. Te recomiendo que busques en la web y SO para ver algunos ejemplos de cómo hacerlo mejor.