Skip site navigation (1) Skip section navigation (2)

JDBC Newbie Question

From: "John McLaughlin" <johnm(at)oei(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: JDBC Newbie Question
Date: 2001-10-19 02:46:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
I am doing some first tinkering with JDBC and PostgreSQL and I am stumped on

I have a simple Java program that queries a table on the PostgreSQL
workstation successfully.  I can iterate through the rows and display them.
However, when I try to update a value, like using:
    ResultSet rs;
    rs.updateInt("columnName", newIntVal);

The rs.updateInt() seems to succeed (no exceptions thrown), but the database
never gets changed.  I am using JBuilder 4, and I *can* make changes to the
DB using the Data Explorer tool.  So, the jdbc driver appears to be working.

FYI, my connection logic starts as follows:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");  // load database
    conn = DriverManager.getConnection("jdbc:odbc:postgresql", "myusername",
    stmt =
    res = stmt.executeQuery("SELECT * FROM customer FOR UPDATE");

Any ideas?

John McLaughlin

pgsql-interfaces by date

Next:From: Antonio Sergio de Mello e SouzaDate: 2001-10-19 23:10:45
Subject: ECPG segmentation fault
Previous:From: heroDate: 2001-10-17 06:00:43
Subject: pgaccess select chinese Big5 data error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group