Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help #1019

Closed
Yakabuff opened this issue May 3, 2020 · 3 comments
Closed

Help #1019

Yakabuff opened this issue May 3, 2020 · 3 comments

Comments

@Yakabuff
Copy link

Yakabuff commented May 3, 2020

So I have a very simple table I made in SQL using h2

CREATE TABLE USERS(
    username varchar(255) NOT NULL,
    password varchar(255),

); 

I'm trying to use javalite to add an entry to it so I made this following the instructions on the site.

package DBTEST;

import org.javalite.activejdbc.Base;

public class makeDB {
    public static void main(String[] args) {
        Base.open("org.h2.Driver", "jdbc:h2:./test", "sa", "");

        User e = new User();
        e.set("username", "John");
        e.set("password", "Doe");
        e.saveIt();


        User.findAll().dump();
        Base.close();
    }
}

I have a class Users for this table

package DBTEST;

import org.javalite.activejdbc.Model;
import org.javalite.activejdbc.annotations.Table;

@Table("USERS")
public class User extends Model {
}

I keep getting this exception

Exception in thread "main" org.javalite.activejdbc.DBException: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "USERS" not found; SQL statement:

Can anyone help? I have no idea why this is happening

@ipolevoy
Copy link
Member

ipolevoy commented May 4, 2020

@ipolevoy ipolevoy closed this as completed May 4, 2020
@Yakabuff
Copy link
Author

Yakabuff commented May 5, 2020

Thanks for the help Igor. Much appreciated.

@ipolevoy
Copy link
Member

ipolevoy commented May 5, 2020

@Yakabuff no problem - good luck with your project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants