Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4fb5b92

Browse files
author
Barry Lind
committed
one more change to correctly support the removeall of autocommit
1 parent 9fbd528 commit 4fb5b92

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

+14-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Copyright (c) 2003, PostgreSQL Global Development Group
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.19 2003/05/29 03:21:32 barry Exp $
12+
* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.20 2003/05/29 21:44:47 barry Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -770,15 +770,26 @@ private void openConnectionV2(String host, int port, Properties info, String dat
770770

771771
String dbEncoding = resultSet.getString(2);
772772
encoding = Encoding.getEncoding(dbEncoding, info.getProperty("charSet"));
773+
774+
//TODO: remove this once the set is done as part of V3protocol connection initiation
775+
if (haveMinimumServerVersion("7.4"))
776+
{
777+
BaseResultSet acRset =
778+
execSQL("set client_encoding = 'UNICODE'");
779+
780+
//set encoding to be unicode
781+
encoding = Encoding.getEncoding("UNICODE", null);
782+
}
783+
773784
//In 7.3 we are forced to do a second roundtrip to handle the case
774785
//where a database may not be running in autocommit mode
775786
//jdbc by default assumes autocommit is on until setAutoCommit(false)
776787
//is called. Therefore we need to ensure a new connection is
777788
//initialized to autocommit on.
778789
//We also set the client encoding so that the driver only needs
779-
//to deal with utf8. We can only do this in 7.3 because multibyte
790+
//to deal with utf8. We can only do this in 7.3+ because multibyte
780791
//support is now always included
781-
if (haveMinimumServerVersion("7.3"))
792+
if (haveMinimumServerVersion("7.3") && !haveMinimumServerVersion("7.4"))
782793
{
783794
BaseResultSet acRset =
784795
execSQL("set client_encoding = 'UNICODE'; show autocommit");

0 commit comments

Comments
 (0)