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

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 (view raw or flat)
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

pgsql-jdbc by date

Next:From: Fischer KrisztiƔnDate: 2004-01-19 14:09:15
Subject: ResultSet.previous() - ArrayIndexOutOfBoundsException
Previous:From: Kris JurkaDate: 2004-01-19 09:49:37
Subject: Re: Dreamweaver MX/jdbc

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