Then when trying to access to your database: try { Class.forName("com.mysql.jdbc.Driver"); //loading your JDBC driver Connection connect = DriverManager.getConnection("jdbc:mysql:databasename”, “login”, “password”); Statement statement = connect.createStatement(); // Result set get the result of the SQL query ResultSet resultSet = statement.executeQuery("select * from table_name"); } catch (SQLException e) { throwe; }
Comments
Leave a comment