Received: from setserv.setech.com (setserv.setech.com [209.61.40.195]) by hub.org (8.8.8/8.7.5) with ESMTP id PAA02986 for ; Thu, 2 Jul 1998 15:02:38 -0400 (EDT) Received: from setech.com (setech.com [209.61.40.194]) by setserv.setech.com (8.8.8/8.8.8) with ESMTP id PAA21972 for ; Thu, 2 Jul 1998 15:01:41 -0400 (EDT) Sender: root@setserv.setech.com Message-ID: <359BD804.6D60872F@setech.com> Date: Thu, 02 Jul 1998 14:57:08 -0400 From: Jeffrey Napolitano X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.29 i586) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: JDBC and DriverManager Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Okay...the below code compiles fine, but when it runs, it throws the SQLException at the DriverManager line (as you can see, everything below is commented out). There is indeed a datasource "bugs", and PostgreSQL is running on the local machine. There is no password needed to access the database, and I can access "bugs" interactively with psql. Am I not importing a package...? I need help...am lost to why it throws the SQLException. ------------------------------------------------------------ import java.util.*; import java.io.*; import java.sql.*; public class HopeSprings { public static void main(String[] args) { String url = "jdbc:postgresql:bugs"; Connection con; String createString; createString = "create table STUFF " + "(NAME varchar(30), " + "IDNUMBER int)"; Statement stmt; try { Class.forName("postgresql.Driver"); } catch(ClassNotFoundException except) { System.out.println("ClassNotFound: didn't work"); } try { con = DriverManager.getConnection(url); //stmt = con.createStatement(); //stmt.executeUpdate(createString); //stmt.close(); //con.close(); } catch(SQLException sqlexcept) { System.out.println("The SQL Exception was thrown"); } } //End of main in JDBC_Connection class } //End of JDBC_Connection class bracket