Guest User

Untitled

a guest
Aug 18th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. error connecting to mysql using java
  2. String url = "jdbc:mysql://localhost:3306/";
  3. String dbName = "mta_db";
  4. String driver = "com.mysql.jdbc.Driver";
  5. String userName = "tomcat";
  6. String password = "tomcat";
  7. try {
  8. Class.forName(driver).newInstance();
  9. _conn = DriverManager.getConnection(url + dbName, userName, password);
  10. } catch (Exception e) {
  11. e.printStackTrace();
  12. }
  13.  
  14. GRANT ALL ON mta_db.* to tomcat@'%' identified by 'yourpassword';
Add Comment
Please, Sign In to add comment