0

I am trying to connect derby database and inserting some value to the table.for that i use the bellow code.

Class.forName("org.apache.derby.jdbc.ClientDriver");
Connection con=DriverManager.getConnection(
        "jdbc:derby://localhost:1527/raptor;create=true","root","root");
if (con != null) {
    System.out.println("Connected to database - mydb");
}
Statement st=con.createStatement();
String q="insert into VINOTH values(7)";

st.executeUpdate(q);

In the above code when calling getConnection method I give database user "root" and password as "root", but it gives me the error

Schema 'ROOT' does not exist

Actually root was a database user but it takes as a schema. Why is this happening?

If I give "APP" instead of database user "root" it is working fine. But I need to know why it doesn't take my user and password.

Jiri Tousek
  • 12,211
  • 5
  • 29
  • 43
KVK
  • 1,257
  • 2
  • 17
  • 48

0 Answers0