[libpostgresql-jdbc-java] 13/14: commit changes to CallableStatement test, and protocolImplementations to STABLE
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to tag REL8_0_312
in repository libpostgresql-jdbc-java.
commit 5ed604bffdc74614f8b83faf241f801b0f753c0b
Author: Dave Cramer <davec at fastcrypt.com>
Date: Tue Jun 21 20:11:53 2005 +0000
commit changes to CallableStatement test, and protocolImplementations to
STABLE
---
org/postgresql/core/ProtocolConnection.java | 8 +++++++-
org/postgresql/core/v2/ProtocolConnectionImpl.java | 8 ++++++--
org/postgresql/core/v3/ProtocolConnectionImpl.java | 9 +++++++--
org/postgresql/jdbc2/AbstractJdbc2Connection.java | 8 ++++++--
org/postgresql/test/TestUtil.java | 14 +++++++++++++-
org/postgresql/test/jdbc2/CallableStmtTest.java | 15 +++++++++------
6 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/org/postgresql/core/ProtocolConnection.java b/org/postgresql/core/ProtocolConnection.java
index c2eb22e..9e7e2db 100644
--- a/org/postgresql/core/ProtocolConnection.java
+++ b/org/postgresql/core/ProtocolConnection.java
@@ -4,7 +4,7 @@
* Copyright (c) 2004, Open Cloud Limited.
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/core/ProtocolConnection.java,v 1.3 2004/11/09 08:44:43 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/core/ProtocolConnection.java,v 1.4 2005/01/11 08:25:43 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -114,4 +114,10 @@ public interface ProtocolConnection {
* @return true iff the connection is closed.
*/
boolean isClosed();
+
+ /**
+ *
+ * @return the version of the implementation
+ */
+ public int getProtocolVersion();
}
diff --git a/org/postgresql/core/v2/ProtocolConnectionImpl.java b/org/postgresql/core/v2/ProtocolConnectionImpl.java
index 43cbe30..0e57a94 100644
--- a/org/postgresql/core/v2/ProtocolConnectionImpl.java
+++ b/org/postgresql/core/v2/ProtocolConnectionImpl.java
@@ -4,7 +4,7 @@
* Copyright (c) 2004, Open Cloud Limited.
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/core/v2/ProtocolConnectionImpl.java,v 1.4 2004/11/09 08:45:31 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/core/v2/ProtocolConnectionImpl.java,v 1.5 2005/01/11 08:25:43 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -186,7 +186,11 @@ class ProtocolConnectionImpl implements ProtocolConnection {
{
transactionState = state;
}
-
+
+ public int getProtocolVersion()
+ {
+ return 2;
+ }
private String serverVersion;
private int cancelPid;
private int cancelKey;
diff --git a/org/postgresql/core/v3/ProtocolConnectionImpl.java b/org/postgresql/core/v3/ProtocolConnectionImpl.java
index 7f3a27c..6377868 100644
--- a/org/postgresql/core/v3/ProtocolConnectionImpl.java
+++ b/org/postgresql/core/v3/ProtocolConnectionImpl.java
@@ -4,7 +4,7 @@
* Copyright (c) 2004, Open Cloud Limited.
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/core/v3/ProtocolConnectionImpl.java,v 1.5 2004/12/11 03:31:52 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/core/v3/ProtocolConnectionImpl.java,v 1.6 2005/01/11 08:25:44 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -182,7 +182,12 @@ class ProtocolConnectionImpl implements ProtocolConnection {
{
transactionState = state;
}
-
+
+ public int getProtocolVersion()
+ {
+ return 3;
+ }
+
private String serverVersion;
private int cancelPid;
private int cancelKey;
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
index 132e080..8b44e21 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
@@ -3,7 +3,7 @@
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java,v 1.26 2005/01/25 06:21:21 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java,v 1.26.2.1 2005/02/15 08:55:50 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1103,7 +1103,11 @@ public abstract class AbstractJdbc2Connection implements BaseConnection
return Types.OTHER;
}
-
+
+ public int getProtocolVersion()
+ {
+ return protoConnection.getProtocolVersion();
+ }
/*
* This table holds the org.postgresql names for the types supported.
* Any types that map to Types.OTHER (eg POINT) don't go into this table.
diff --git a/org/postgresql/test/TestUtil.java b/org/postgresql/test/TestUtil.java
index fdaab2f..c5c5677 100644
--- a/org/postgresql/test/TestUtil.java
+++ b/org/postgresql/test/TestUtil.java
@@ -3,7 +3,7 @@
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/test/TestUtil.java,v 1.16 2005/01/05 00:53:04 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/test/TestUtil.java,v 1.17 2005/01/11 08:25:47 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -12,6 +12,8 @@ package org.postgresql.test;
import java.sql.*;
import java.util.Properties;
+import org.postgresql.jdbc2.AbstractJdbc2Connection;
+
/**
* Utility class for JDBC tests
*/
@@ -290,6 +292,16 @@ public class TestUtil
String jvm = java.lang.System.getProperty("java.version");
return (jvm.compareTo(version) >= 0);
}
+
+ public static boolean isProtocolVersion( Connection con, int version )
+ {
+ if ( con instanceof AbstractJdbc2Connection )
+ {
+ return (version == ((AbstractJdbc2Connection)con).getProtocolVersion());
+
+ }
+ return false;
+ }
/**
* Print a ResultSet to System.out.
diff --git a/org/postgresql/test/jdbc2/CallableStmtTest.java b/org/postgresql/test/jdbc2/CallableStmtTest.java
index e48e213..23341d5 100644
--- a/org/postgresql/test/jdbc2/CallableStmtTest.java
+++ b/org/postgresql/test/jdbc2/CallableStmtTest.java
@@ -3,7 +3,7 @@
* Copyright (c) 2004-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v 1.12.2.1 2005/02/10 19:52:45 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v 1.12.2.2 2005/06/08 16:21:02 davec Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,11 +95,14 @@ public class CallableStmtTest extends TestCase
public void testGetShort () throws Throwable
{
- CallableStatement call = con.prepareCall (func + pkgName + "getShort (?) }");
- call.setShort (2, (short)4);
- call.registerOutParameter (1, Types.SMALLINT);
- call.execute ();
- assertEquals(42, call.getShort(1));
+ if ( TestUtil.isProtocolVersion(con, 3) )
+ {
+ CallableStatement call = con.prepareCall (func + pkgName + "getShort (?) }");
+ call.setShort (2, (short)4);
+ call.registerOutParameter (1, Types.SMALLINT);
+ call.execute ();
+ assertEquals(42, call.getShort(1));
+ }
}
public void testGetNumeric () throws Throwable
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list