clarification needed in postgresql... + transactions...

From: dinakar <din_akar(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: clarification needed in postgresql... + transactions...
Date: 2004-01-19 12:17:18
Message-ID: 20040119121718.43298.qmail@web10704.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

hi all,

i need a clarification in java + postgresql.

currently iam using tomcat 4.0, jdk 1.4, postgresql
7.3.x.

i using the below code to fetch data from database,

con =
DriverManager.getConnection("jdbc:postgresql://192.168.2.51:5432/wsas_test","wsas",
"wsas");

//con.setAutoCommit(false);
System.out.println(con.getAutoCommit());
preStmt = con.prepareStatement("BEGIN;SELECT
fn_list_allpatients('cursor_name');");
resultSet = preStmt.executeQuery();
String strCn = "cursor_name";
preStmt = con.prepareStatement("FETCH ALL IN \"" +
strCn + "\";END;");
resultSet = preStmt.executeQuery();
//con.setAutoCommit(true);
while (resultSet.next())
{
System.out.println(resultSet.getString(1) +
resultSet.getString("patient_title"));
}

if i dont use the setautocommit to false and true
respectively the above code is not working,

i need to know will the above code create any problem
in multiuser application...

currently iam facing a problem that some transactions
are ideal even after closing the connection to
database...

please advice..

thanks
dinakar

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Fischer Krisztián 2004-01-19 14:09:15 ResultSet.previous() - ArrayIndexOutOfBoundsException
Previous Message Kris Jurka 2004-01-19 09:49:37 Re: Dreamweaver MX/jdbc