Non so se cambi tanto ma prova senza ' per i wildcard.
codice:
public int create(User u)
{
Connection c = DBDataSource.getJDBCConnection();
try
{
PreparedStatement st = c.prepareStatement("INSERT into users (id ,nick, pass) VALUES (seq_users.nextval, ?, ?)");
st.setString(1, u.getNick());
st.setString(2, u.getPass());
st.executeUpdate();
c.commit();
c.close();
return u.getId();
}
catch (SQLException ex)
{
Logger.getLogger(UsersDAO.class.getName()).log(Level.SEVERE, null, ex);
return -1;
}
}
Ma perché fai un return di un valore che hai passato come parametro
codice:
public void create(User u) throws SQLException
{
Connection c = DBDataSource.getJDBCConnection();
PreparedStatement st = c.prepareStatement("INSERT into users (id ,nick, pass) VALUES (seq_users.nextval, ?, ?)");
st.setString(1, u.getNick());
st.setString(2, u.getPass());
st.executeUpdate();
c.commit();
c.close();
}