Read transactions don't work on 7.0.x db's

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Read transactions don't work on 7.0.x db's
Date: 2001-08-31 00:50:54
Message-ID: 00bb01c131b6$fdbebfb0$8201a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-patches

The following code fails on a 7.0 db, but works on a 7.1 db

It works fine with the 7.0 jar, but not with the latest code

I had a quick look and everything looks ok. I am going to keep looking
but I thought I would throw this out and see if anyone knows what is
going on

Dave

package test;
import java.sql.*;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2001
* Company:
* @author
* @version 1.0
*/

public class TransactionSelect {

public TransactionSelect()
{
}
public static Connection getConnection( String url, String user,
String password)
{
try {
Class.forName("org.postgresql.Driver");
return java.sql.DriverManager.getConnection(url,user,password);
} catch(ClassNotFoundException ex) {
ex.printStackTrace(System.out);
} catch(SQLException ex) {
ex.printStackTrace(System.out);
}
return null;
}

public static void main(String[] args)
{

try{
Connection con =
getConnection("jdbc:postgresql://192.168.1.1/davec","davec","");
if (con == null){
throw new RuntimeException("no Connection");
}
con.setAutoCommit(false);
PreparedStatement pstmt = con.prepareStatement("select * from
categories" );
ResultSet rs = pstmt.executeQuery();
con.commit();
con.close();
}catch (SQLException ex){
ex.printStackTrace(System.out);
}
}
}

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2001-08-31 01:45:44 Re: [PATCHES] Patch for broken JDBC's getColumn()
Previous Message Bruce Momjian 2001-08-30 22:57:26 Re: [PATCHES] Patch for broken JDBC's getColumn()

Browse pgsql-patches by date

  From Date Subject
Next Message Barry Lind 2001-08-31 01:45:44 Re: [PATCHES] Patch for broken JDBC's getColumn()
Previous Message Bruce Momjian 2001-08-30 22:59:47 Re: ADD CONSTRAINT UNIQUE patch