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

How do I ensure same session over multiple statements??

From: Sean Shanny <shannyconsulting(at)earthlink(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: How do I ensure same session over multiple statements??
Date: 2004-02-20 22:27:32
Message-ID: 403689D4.6010801@earthlink.net (view raw or flat)
Thread:
Lists: pgsql-jdbc
To all,

I have a situation where I need to issue the following:

set enable_nestloop = off

before executing a prepared statement.  We are using connection pooling. 
m_conn is a connection object that is retrieved earlier in the code.

Code fragment....

PreparedStatement ps = null;
        ResultSet rs = null;

        try
        {
            NEED TO DO THE SET HERE
            ps = m_conn.prepareStatement(
                "SELECT t1.id, t2.md5, t2.url from referral_temp t2 LEFT 
OUTER JOIN d_referral t1 ON t2.md5 = t1.referral_md5" );
            ps.setFetchSize( T_FETCH_SIZE );

            rs = ps.executeQuery();

            WHEN I AM DONE LIKE TO REVERSE THE SET

       .......

I can do this just fine through psql since I am always in the same 
session.  How would I do that given the above code fragment?

Thanks.

--sean

Responses

pgsql-jdbc by date

Next:From: Oliver JowettDate: 2004-02-20 23:57:48
Subject: Re: JDBC3 and 7.4.1
Previous:From: Ranjeet KapurDate: 2004-02-20 20:21:00
Subject: Re: JDBC3 and 7.4.1

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