Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 94198 invoked from network); 14 Dec 2009 21:30:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Dec 2009 21:30:46 -0000 Received: (qmail 71524 invoked by uid 500); 14 Dec 2009 21:30:46 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 71481 invoked by uid 500); 14 Dec 2009 21:30:45 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 71472 invoked by uid 99); 14 Dec 2009 21:30:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2009 21:30:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Dec 2009 21:30:36 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NKIUh-0003Q3-2y for derby-user@db.apache.org; Mon, 14 Dec 2009 13:30:15 -0800 Message-ID: <26780099.post@talk.nabble.com> Date: Mon, 14 Dec 2009 13:30:15 -0800 (PST) From: Wildman To: derby-user@db.apache.org Subject: SQLException Table does not exist although just created MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: wleue1@nycap.rr.com X-Virus-Checked: Checked by ClamAV on apache.org I am trying to move a Java database application from mySQL to the embedded version of the Java Database (nee Derby). I successfully create an instance of the DriverManager and make a connection. Next, I create several tables. Next I try to use the SYSCS_UTIL.SYSCS_IMPORT utility to load data from a CSV file into the tables I have just created. I get the following error: java.sql.SQLException: Table 'BILL.part_type' does not exist. ...even though I have just created the table 'part_type' a few lines above. Is this possibly related to the 'BILL' schema? When I create the tables, I don't specify or create any schema, although I do log in as 'Bill' when I open the database connection. A version of my source, edited for brevity, follows. Thanks! -Bill - - - - - - - - - - - - - - Properties props = new Properties(); props.put("user", "Bill"); props.put("password", "******"); // password masked in this copy String full_url = URL + DEFAULT_DB + ";create=true"; try { con = DriverManager.getConnection(full_url, props); } catch (Exception e2) { JOptionPane.showMessageDialog(this.gui, "Sorry, got an exception creating the new database: " + e2, "Fatal", JOptionPane.INFORMATION_MESSAGE); e2.printStackTrace(System.out); return -1; } // drop any existing tables - ignore errors try { sendSQL("drop table part_type"); } // etc.. try { sql = "create table part_type (" + "part_type_id INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," + "partnum varchar(20)," + "name varchar(255)," + "family varchar(40)," + "genus varchar(20)," + "image varchar(1)" + ")"; sendSQL(sql); // this sends theSQL string to the connection String infile = getStartDir() + File.separator + "Partsref.csv"; sql = "CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE (null, 'part_type', '" + infile + "', null, null, null, 1)"; System.err.println(sql); sendSQL(sql); // <-- exception here - - - - - - - - - - - - - - - - - - -- View this message in context: http://old.nabble.com/SQLException-Table-does-not-exist-although-just-created-tp26780099p26780099.html Sent from the Apache Derby Users mailing list archive at Nabble.com.