I run my program, the database is attached to after which it provides me with two errors. One saying 'Schema "ROOT" doesn't exist' and the other saying 'Lexical error at line 1, column 8. Experienced: "@"(64), after:"".

This is actually the code in the two SQL claims:

private void UpdateJTable() {
    String sql ="select idhonscores AS RowNo , Name, Characters, Kills, Deaths, Assists, XPM, CK from honscores";
    try {
        st = conn.prepareStatement(sql);
        rs = st.executeQuery();

    } catch(Exception e) {
        JOptionPane.showMessageDialog(null, e);


That's in the first error and

String sql3 ="SELECT "+"@rn:=@rn+1"+" AS Rank, Name, Kills FROM (Select Name, sum(Kills) as Kills from honscores group by Name order by Kills DESC) t1, (SELECT "+"@rn:=0"+") t2;";

Is perfect for the 2nd error

  1. In derby the default schema is definitely the schema from the user you utilize to produce the jdbc connection. I can not tell of your stuff question, the way you initialize and setup the derby database. But appending ;create=true towards the jdbc-url may help (this can produce the db and schema if it doesn't exist).

You are able to change to a different schema by performing:

  1. The @-syntax is probably not obtainable in derby. Not exactly what works in another db (especially if it's db specific) works in derby.