Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7046761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:41:20+00:00 2026-05-28T02:41:20+00:00

I’m using the H2 database in my Java project (embedded mode). On my computer

  • 0

I’m using the H2 database in my Java project (embedded mode).
On my computer at home everything works, the connection can be established, but on all other computers I always receive the following error:

org.h2.jdbc.JdbcSQLException: Table “CUSTOMERS” not found; SQL
statement: SELECT * FROM CUSTOMERS [42102-162]

I’m sure, that within the DB everything is alright, it should be something with the connection.
But even if I import the h2-1.3.162.jar file, the error still remains.

String dbClass = "org.h2.Driver";
String dbDriver = "jdbc:h2:~/cc";
String user = "user1";
String pass = "test1";
private Connection conn = null;
private Statement stmt = null;
private ResultSet rs = null;

public void connect() {
    boolean done = false;
    //load driver
    try {
        Class.forName(dbClass).newInstance();
        System.out.println("driver loaded"); // This is shown in the Compiler
    } catch (Exception ex) {
        System.out.println("error while loading driver");
        System.err.println(ex);
    }
    // Connection
    try {
        conn = DriverManager.getConnection(dbDriver, user, pass);
        System.out.println("connected"); // This is shown in the Compiler
        done = true;
    } catch (SQLException ex) {
        System.out.println("SQLException: " + ex.getMessage());
        System.out.println("SQLState: " + ex.getSQLState());
        System.out.println("VendorError: " + ex.getErrorCode());
    }
}

public Vector select() {
    data = new Vector();
    try {
        stmt = conn.createStatement();
        rs = stmt.executeQuery("SELECT * FROM CUSTOMERS");
        while (rs.next()) {
            Vector row = new Vector();
            row.add(rs.getInt("id"));
            row.add(rs.getString("fname"));
            row.add(rs.getString("lname"));
            row.add(rs.getString("street"));
            row.add(rs.getString("city"));
            row.add(rs.getString("zip"));
            row.add(rs.getString("state"));
            row.add(rs.getString("phone"));
            row.add(rs.getString("birthday"));
            row.add(rs.getString("email"));
            row.add(rs.getInt("code"));
            data.add(row);
        }
        rs.close();
        stmt.close();
    } catch (SQLException ex) {
        System.out.println("error while selecting"); // I receive this error
        System.err.println(ex);
    }
    return data;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:41:21+00:00Added an answer on May 28, 2026 at 2:41 am

    Finally I figured it out!

    It had nothing to do with my tables, the database couldn’t be found. When trying to connect to a database which can’t be found with String dbDriver = "jdbc:h2:~/cc";, a new database with the name cc (in my case) will be created (of course an empty one with no tables) and the connection is established. That’s why I haven’t received any connection errors.
    In the next step I tried to retrieve some data from the new created empty database and therefore received the error, that my table doesn’t exist.

    So I changed this line: String dbDriver = "jdbc:h2:file:lib/cc"; and copied into the lib directory of my application my old database cc.h2.db.

    That’s all!

    PS: Here is a similiar problem: h2 (embedded mode ) database files problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.