Received: from mail3.one.net (IDENT:0@mail3.one.net [206.112.192.120]) by hub.org (8.10.1/8.10.1) with ESMTP id e84JPcC55471 for ; Mon, 4 Sep 2000 15:25:38 -0400 (EDT) Received: from port-cvx1-163.access.one.net ([216.23.19.163] EHLO one.net ident: IDENT-NOT-QUERIED [port 51462]) by mail2.one.net with ESMTP id <117636-5016>; Mon, 4 Sep 2000 15:25:31 -0400 Message-ID: <39B3FAD7.D4603E09@one.net> From: Eric Buschelmann X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: JDBC Driver Help... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 4 Sep 2000 15:25:18 -0400 X-Archive-Number: 200009/15 I am attempting to use the following code.... However, I seem to always get to the SQL EXCEPTION (on the query)... What am I doing wrong? I'm sure it is simple -- but still it is frustrating :) I'm not sure if this is related to the use of the driver or my configuration -- if anything -- a URL with some FAQ's would help... The details in the JDBC (postgres) guide are a little slim... Thanks Eric ehb@One.net /* * * Test.java * */ import java.awt.*; import java.awt.event.*; import java.io.*; import java.applet.*; /* import necessary for PGSQL */ import java.sql.*; public class Test extends Applet implements ActionListener, TextListener { Button newButton=new Button("New"); Panel flow3 = new Panel (new FlowLayout(FlowLayout.LEFT,5,5)); TextArea textArea2 = new TextArea ("",5,10,TextArea.SCROLLBARS_BOTH); Panel border1 = new Panel (new BorderLayout(5,5)); public void init() { this.setLayout(new BorderLayout()); this.setBackground(SystemColor.control); this.setForeground(SystemColor.controlText); newButton.addActionListener(this); flow3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); flow3.add(newButton); textArea2.setText("Starting text..."); textArea2.setBackground(SystemColor.window); textArea2.setForeground(SystemColor.windowText); textArea2.addTextListener(this); border1.add("North",flow3); border1.add("Center",textArea2); add("Center",border1); } public void actionPerformed(ActionEvent evt) { if (evt.getSource() == newButton ) { Connection con = null; try { Class.forName("org.postgresql.Driver").newInstance(); con=DriverManager.getConnection ("jdbc:postgresql:ehb","ehb","rhimgeti"); textArea2.setText("SUCCESSFULL connection object"); } catch (SQLException excpt0) { textArea2.setText("EXCEPTION0"); } catch (ClassNotFoundException excpt1) { textArea2.setText("EXCEPTION1"); } catch (InstantiationException excpt2) { textArea2.setText("EXCEPTION2"); } catch (IllegalAccessException excpt3) { textArea2.setText("EXCEPTION3"); } /* there should be a connection now*/ try { Statement st = con.createStatement(); ResultSet rs = st.executeQuery("insert into test values(2);"); rs.close(); st.close(); con.close(); } catch (SQLException excpt0) { textArea2.setText("SQL EXCEPTION ON QUERY!!!"); } } } public void textValueChanged(TextEvent evt) { String[] test = new String[2]; } } /* end class*/