Hey,
I have been trying for quite some times already and have been through some tutorials, but i need some help.
I want to use a MySql Database in order to allow my plugin to easily manage multiples data.
Here is the code I am using to create a database:
try {
Class.forName( "com.mysql.jdbc.Driver" );
System.out.println("driver: ok");
String url = "jdbc:mysql://localhost/";
String user = "root";
String pass = "mypassword";
Connection conn = DriverManager.getConnection(url, user, pass);
Statement state = conn.createStatement();
state.executeQuery("CREATE DATABASE MyDataBase");
state.close();
} catch ( ClassNotFoundException | SQLException e ) {
System.out.println("===error===");
}
By runing the plugin with the server, I only receive the error message, so i guess the issue comes from the importation of the Driver.
I already cofigured the project to add the external library “mysql-connector-java-5.1.38-bin.jar” that contains the Driver.
I don’t know if I need to give the Jar to the server, so that it could understand, and how to do so.
So I came here with hope that someone could explain me what are the requiered code and configurations
to make this thing work.