How do I ensure same session over multiple statements?? - Mailing list pgsql-jdbc

From Sean Shanny
Subject How do I ensure same session over multiple statements??
Date
Msg-id 403689D4.6010801@earthlink.net
Whole thread Raw
Responses Re: How do I ensure same session over multiple statements??
List 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

pgsql-jdbc by date:

Previous
From: Ranjeet Kapur
Date:
Subject: Re: JDBC3 and 7.4.1
Next
From: Oliver Jowett
Date:
Subject: Re: How do I ensure same session over multiple statements??