I run my program, the database is connected to and then it gives me two errors. One saying
'Schema "ROOT" does not exist'
and another saying
'Lexical error at line 1, column 8. Encountered: "@"(64), after:"".
Here is the code from the two SQL statements:
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();
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch(Exception e) {
JOptionPane.showMessageDialog(null, e);
}
}
That is from 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 for the second error
;create=true
to the jdbc-url might help (this will create the db and schema if it does not exist).You can change to a different schema by executing:
SET SCHEMA MYSCHEMA;