Received: from flex.flex.ro (IDENT:root@flex.flex.ro [193.230.255.2]) by hub.org (8.9.1/8.9.1) with ESMTP id DAA18968 for ; Thu, 31 Dec 1998 03:29:29 -0500 (EST) (envelope-from teo@flex.ro) Received: from flex.ro (IDENT:teo@flex.flex.ro [193.230.255.2]) by flex.flex.ro (8.9.1/8.9.1) with ESMTP id KAA05201; Thu, 31 Dec 1998 10:26:56 +0200 Sender: teo@flex.flex.ro Message-ID: <368B3550.D79D8323@flex.ro> Date: Thu, 31 Dec 1998 10:26:56 +0200 From: Constantin Teodorescu Organization: FLEX Consulting X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i686) MIME-Version: 1.0 To: Peter T Mount CC: PostgreSQL Interfaces Subject: Re: [INTERFACES] JDBC example is not working with Kaffe 1.0b3 References: Content-Type: multipart/mixed; boundary="------------7873E6CB1E7D9304EF9BC48C" This is a multi-part message in MIME format. --------------7873E6CB1E7D9304EF9BC48C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Peter T Mount wrote: > > It looks like Kaffe is having problems with it's IO. I have Redhat 5.2 > here, so I'll try it's Kaffe, and see if it has the same problem. > Which one of the examples are you using? I am using a simple program derived from example basic.java. There are no significant changes inside, just the database name, name of table and fields and maybe their types. But the main idea is the same. Create a table, put some records inside and select them. I am attaching the java source to this e-mail. You should replace "contabil" database name with your own. Just a moment please, I want to verify if the original basic example is working with kaffe. ... SURPRISE !!!! The original basic.java is working good also with jdk 1.1.7 and with kaffe !!!! But why it crashes with my program ? This would be more interesting to see it! It's 10:30 in Romania. C ya in 1999 ! I wish you A Happy New Year to all of you ! -- Constantin Teodorescu FLEX Consulting Braila, ROMANIA --------------7873E6CB1E7D9304EF9BC48C Content-Type: text/plain; charset=us-ascii; name="dbt.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dbt.java" import java.io.*; import java.sql.*; import java.text.*; public class dbt { Connection db; Statement st; public dbt(String args[]) throws ClassNotFoundException, FileNotFoundException, IOException, SQLException { Class.forName("postgresql.Driver"); db = DriverManager.getConnection("jdbc:postgresql:contabil", "postgres", "postgres"); st = db.createStatement(); cleanup(); doexample(); //cleanup(); System.out.println("Now closing the connection"); st.close(); db.close(); } public void cleanup() { try { st.executeUpdate("drop table teste"); } catch(Exception ex) { // We ignore any errors here } } public void doexample() throws SQLException { System.out.println("\nRunning tests:"); st.executeUpdate("create table teste (id int2,nume text)"); st.executeUpdate("insert into teste values (1,'vasile')"); st.executeUpdate("insert into teste values (2,'ion')"); st.executeUpdate("insert into teste values (3,'gelu')"); System.out.println("performing a query"); //ResultSet rs = st.executeQuery("select * from teste"); System.out.println("Facem selectul ..."); ResultSet rs = st.executeQuery("select nume from teste"); System.out.println("L-am facut"); if(rs!=null) { while(rs.next()) { //int a = rs.getInt("id"); String b = rs.getString(1); //System.out.println(" id="+a+" nume="+b); System.out.println("nume="+b); } rs.close(); } } public static void main(String args[]) { // Now run the tests try { dbt test = new dbt(args); } catch(Exception ex) { System.err.println("Exception caught.\n"+ex); ex.printStackTrace(); } } } --------------7873E6CB1E7D9304EF9BC48C--