werid problem, please help, thanks very much!!!
I am getting a error when I try to get a connection, the werid thing is I can called the getConnection method with no problem from some project but got below erros in other projects:
java.lang.NoSuchMethodError: org.apache.derby.jdbc.InternalDriver.embeddedDriverAcceptsURL(Ljava/lang/String;)Z
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
my code is:
private static final String driver = "com.mysql.jdbc.Driver";
private static final String dbName="Umbrella";
private static final String connectionURL = "jdbc:mysql://localhost:3306/" + dbName;
Connection conn = null;
conn = DriverManager.getConnection(connectionURL, "root", "password");
I don't know why there is anything to do with derby! i am using mysql(I was using derby before but I changed it) and from the connection string there is no way the code is calling derby and the code in fact was fine with some project (I am using eclipse)
I think the code is correct but do I need to check any configuration settings?