Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error connecting to mysql using java
- String url = "jdbc:mysql://localhost:3306/";
- String dbName = "mta_db";
- String driver = "com.mysql.jdbc.Driver";
- String userName = "tomcat";
- String password = "tomcat";
- try {
- Class.forName(driver).newInstance();
- _conn = DriverManager.getConnection(url + dbName, userName, password);
- } catch (Exception e) {
- e.printStackTrace();
- }
- GRANT ALL ON mta_db.* to tomcat@'%' identified by 'yourpassword';
Add Comment
Please, Sign In to add comment