Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4fb5b92

Browse files
author
Barry Lind
committed
one more change to correctly support the removeall of autocommit
1 parent9fbd528 commit4fb5b92

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
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/2903: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
StringdbEncoding =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+
BaseResultSetacRset =
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
BaseResultSetacRset =
784795
execSQL("set client_encoding = 'UNICODE'; show autocommit");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp