Results 1 to 3 of 3

Thread: Embedded Database

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Location
    In Texas.
    Posts
    15

    Question Embedded Database

    I am having a hard time implementing an embedded DB. First off, I am using java to connect to the DB and manipulate the information it contains. I can successfully connect to and work with Derby, but I need an application like Access to create and enter the 100+ lines of information. When I open the Derby DB in OpenOffice Base, it will not allow me to edit my data.

    Which brings me to attempt number 2. I created a DB with OO Base, but when I query the new DB with Java, It gives me a "table not found in statement" error. I ran a simple Select * From defs query. I can get the statement to execute in OO by adding quotation marks to the table name like so: Select * From "defs". If I leave off the quotation marks, I get the previously defined error.

    Does anyone have any clue about what may be going on? Would someone have any suggestions about another approach to adding an embedded DB to my app? Any help would be greatly appreciated.
    Just remember love is life
    And hate is living death
    Treat your life for what it's worth
    And live for every breath

  2. #2
    Security Intelligence TZ Veteran cash_site's Avatar
    Join Date
    Jul 2002
    Location
    Software Paradise
    Posts
    3,735
    Firstly, sounds like a syntax issue. Ie different software interfaces use different semantics like u found with the quotations etc... check the manuals for setting up a correct DB-> APP connection. Look into ODBC if u can, and all see if ur doing a stored procedure or execute reader...etc


    Also, have a look at MSDE (cut down version of MS-SQL) or even look at MySQL...

    --- 0wN3D by 3gG ---

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Location
    In Texas.
    Posts
    15
    Thanks for your reply cash site. I have looked at the documentation for hsqldb, and it appear that the query is formed properly. I have used UPPERCASE letters for the table name as required, but am wondering if it may be a connection issue. here is my connection code:
    Code:
    try {
    		 String driverName = "org.hsqldb.jdbcDriver"; 
     String url = "jdbc:hsqldb:viri";
     //String username = "";
     //String password = "" ;
    
    				Class.forName(driverName).newInstance();
                dbConn = DriverManager.getConnection(url);
    	  // Java SQL objects...	 
    
    	   Statement stmt; 
               ResultSet rs;    
    
    	   stmt = dbConn.createStatement();
    	 
               rs = stmt.executeQuery("SELECT * FROM DEFINITIONS");
                         rs.close(); 
            }
         
         	catch (Exception e) {
               System.out.println("Whoops! Something went wrong. \n");
    	   e.printStackTrace();
           getThis().dispose();
            }
    I am running the application with -classpath <path to jarfile>\hsqldb.jar
    I replaced the "jdbc:hsqldb:viri" statement with "jdbc:hsqldb:nonexistantDB"
    and ran the same query with the same result. Any suggestions?
    Just remember love is life
    And hate is living death
    Treat your life for what it's worth
    And live for every breath

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •