Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 13B5E4759F9 for ; Mon, 19 Aug 2002 01:15:44 -0400 (EDT) Received: from hotmail.com (f108.pav1.hotmail.com [64.4.31.108]) by postgresql.org (Postfix) with ESMTP id 2E1A547597B for ; Mon, 19 Aug 2002 01:15:43 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 18 Aug 2002 22:15:42 -0700 Received: from 134.193.24.3 by pv1fd.pav1.hotmail.msn.com with HTTP; Mon, 19 Aug 2002 05:15:42 GMT X-Originating-IP: [134.193.24.3] From: "Andrew Lee" To: pgsql-jdbc@postgresql.org Subject: Error using JDBC2 postgres driver and DatabaseMetaData.getTables() Date: Mon, 19 Aug 2002 05:15:42 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 19 Aug 2002 05:15:42.0791 (UTC) FILETIME=[772F8570:01C2473F] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/130 X-Sequence-Number: 4576 I am attempting to use an Object Relational Code Generation engine (cartographer, http://cartographer.sourceforge.com) with a database that I have in Postgresql 7.2 running under RedHat Linux 7.3 and JDK 1.4.0_01. The error I am encountering, and the stack trace are: //----- Begin Error Message -----// java.sql.SQLException: ERROR: parser: parse error at or near ")" at org.postgresql.core.QueryExecutor.execute(Unknown Source) at org.postgresql.Connection.ExecSQL(Unknown Source) at org.postgresql.Connection.ExecSQL(Unknown Source) at org.postgresql.jdbc2.DatabaseMetaData.getTables(Unknown Source) at cartographer.Mapper.mapDatasource(Mapper.java:133) at cartographer.Cartographer.main(Cartographer.java:109) //----- End Error Message -----// The offending piece of code in the Mapper object follows: //----- Begin Code Block -----// private Properties props; public Mapper(Properties props) { this.props = props; } /** * */ public Vector mapDatasource() { Connection con = null; ResultSet rs = null; String [] tableTypes = { "Table" }; Vector tableNameVector = new Vector(); try { log("Connecting to datasource: " + props.getProperty("url")); ConnectionManager cm = new ConnectionManager(props.getProperty("driver"), props.getProperty("url"), props.getProperty("user"), props.getProperty("pass") ); con = cm.getConnection(); DatabaseMetaData dbmd = con.getMetaData(); log("Database: " + dbmd.getDatabaseProductName()); log("Database Version: " + dbmd.getDatabaseProductVersion()); log("Driver: " + dbmd.getDriverName()); log("Driver Version: " + dbmd.getDriverVersion()); log("\n"); rs = dbmd.getTables(null,null,null,tableTypes); //rs = dbmd.getTables(null,null,null,null); while( rs.next() ) { tableNameVector.addElement(rs.getString(3)); } rs.close(); con.close(); } catch(SQLException sqle) { sqle.printStackTrace(); } catch(Exception e) { e.printStackTrace(); } return tableNameVector; } //----- End Code Block -----// The stack trace points to line 133 which is: rs = dbmd.getTables(null,null,null,tableTypes); I have also tried: rs = dbmd.getTables(null,null,null,null); Both of these methods yield the same error message. I have used this program with other databases and drivers without a problem (e.g. MySql and MS SQL Server 2000). Can anyone see where the problem might be? Or what course of action I could take to fix this problem? Thanks, Andrew Lee alee585@hotmail.com Software Engineer Bensoft, Inc _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx