add missing SQLState by Patrick Higgins
authorDave Cramer <[email protected]>
Fri, 12 Dec 2003 18:39:01 +0000 (18:39 +0000)
committerDave Cramer <[email protected]>
Fri, 12 Dec 2003 18:39:01 +0000 (18:39 +0000)
src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
src/interfaces/jdbc/org/postgresql/util/PSQLException.java

index 0350267b14838f935c77dae82da7ef8b28bdd582..6f19d6e2590997c24e3ce3d6ef0dbdfbe95e001e 100644 (file)
@@ -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 ();
index 22394ed2de4023e043fa2dac37801a99ba540f40..19b06d23676b7e20cbb028e54b3d8dbb75bd5e3f 100644 (file)
@@ -224,6 +224,8 @@ public class PSQLException extends SQLException
        
        public String getSQLState()
        {
+               if (state == null)
+                       return PSQLState.UNKNOWN_STATE.getState();
                return state.getState();
        }
 }