This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to tag REL8_2_506 in repository libpostgresql-jdbc-java.
commit a5f1608c9361637e90c36137e27d03509cb056e1 Author: Kris Jurka <[email protected]> Date: Fri Jun 22 21:37:40 2007 +0000 setObject fails to identify the correct type of java.lang.Byte. Boom Roos --- org/postgresql/jdbc2/AbstractJdbc2Statement.java | 4 +++- org/postgresql/test/jdbc3/TypesTest.java | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/org/postgresql/jdbc2/AbstractJdbc2Statement.java index 1c7f185..db99884 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.96.2.2 2007/02/19 06:04:48 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v 1.96.2.3 2007/03/29 04:27:57 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -1721,6 +1721,8 @@ public abstract class AbstractJdbc2Statement implements BaseStatement setTimestamp(parameterIndex, (Timestamp)x); else if (x instanceof Boolean) setBoolean(parameterIndex, ((Boolean)x).booleanValue()); + else if (x instanceof Byte) + setByte(parameterIndex, ((Byte)x).byteValue()); else if (x instanceof Blob) setBlob(parameterIndex, (Blob)x); else if (x instanceof Clob) diff --git a/org/postgresql/test/jdbc3/TypesTest.java b/org/postgresql/test/jdbc3/TypesTest.java index 477a274..e5d7391 100644 --- a/org/postgresql/test/jdbc3/TypesTest.java +++ b/org/postgresql/test/jdbc3/TypesTest.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc3/TypesTest.java,v 1.8 2005/11/24 02:31:44 oliver Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/test/jdbc3/TypesTest.java,v 1.9 2006/05/15 09:35:57 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -64,6 +64,20 @@ public class TypesTest extends TestCase { } } + public void testPreparedByte() throws SQLException { + PreparedStatement pstmt = _conn.prepareStatement("SELECT ?,?"); + pstmt.setByte(1, (byte)1); + pstmt.setObject(2, Byte.valueOf((byte)2)); + ResultSet rs = pstmt.executeQuery(); + assertTrue(rs.next()); + assertEquals((byte)1, rs.getByte(1)); + assertFalse(rs.wasNull()); + assertEquals((byte)2, rs.getByte(2)); + assertFalse(rs.wasNull()); + rs.close(); + pstmt.close(); + } + public void testCallableBoolean() throws SQLException { CallableStatement cs = _conn.prepareCall("{? = call return_bool(?)}"); cs.registerOutParameter(1, Types.BOOLEAN); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

