summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cramer2003-12-12 18:39:01 +0000
committerDave Cramer2003-12-12 18:39:01 +0000
commitb47863bcd661318255c30bab713663dc8dbd3ba2 (patch)
tree563081e5b4578ae13dd8d3a542d3b9ffe5bf225f
parent2712da556ac1ad372b0662f9eb19e1c9f97779a7 (diff)
add missing SQLState by Patrick Higgins
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java4
-rw-r--r--src/interfaces/jdbc/org/postgresql/util/PSQLException.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
index 0ebbd189f29..9645893987d 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
@@ -26,7 +26,7 @@ import java.sql.Timestamp;
import java.sql.Types;
import java.util.Vector;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41.2.1 2003/12/12 00:27:41 davec Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.41.2.2 2003/12/12 18:39:00 davec Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -526,7 +526,7 @@ public abstract class AbstractJdbc1Statement implements BaseStatement
callResult = result.getObject(1);
int columnType = result.getMetaData().getColumnType(1);
if (columnType != functionReturnType)
- throw new PSQLException ("postgresql.call.wrongrtntype",
+ throw new PSQLException ("postgresql.call.wrongrtntype", PSQLState.DATA_TYPE_MISMATCH,
new Object[]{
"java.sql.Types=" + columnType, "java.sql.Types=" + functionReturnType });
result.close ();
diff --git a/src/interfaces/jdbc/org/postgresql/util/PSQLException.java b/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
index 18b70dc86c8..6df9f428df9 100644
--- a/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
+++ b/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
@@ -7,7 +7,7 @@
* Copyright (c) 2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PSQLException.java,v 1.13 2003/09/08 17:30:22 barry Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PSQLException.java,v 1.13.2.1 2003/12/12 18:39:01 davec Exp $
*
*-------------------------------------------------------------------------
*/
@@ -224,6 +224,8 @@ public class PSQLException extends SQLException
public String getSQLState()
{
+ if (state == null)
+ return PSQLState.UNKNOWN_STATE.getState();
return state.getState();
}
}