Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7ac2f11

Browse files
author
Dave Cramer
committed
add missing SQLState by Patrick Higgins
1 parent 605c1e6 commit 7ac2f11

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import java.sql.Types;
2727
import java.util.Vector;
2828

29-
/* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v 1.43 2003/12/12 00:26:20 davec Exp $
29+
/* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java,v 1.44 2003/12/12 18:36:19 davec Exp $
3030
* This class defines methods of the jdbc1 specification. This class is
3131
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
3232
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -526,7 +526,7 @@ public boolean execute() throws SQLException
526526
callResult = result.getObject(1);
527527
int columnType = result.getMetaData().getColumnType(1);
528528
if (columnType != functionReturnType)
529-
throw new PSQLException ("postgresql.call.wrongrtntype",
529+
throw new PSQLException ("postgresql.call.wrongrtntype", PSQLState.DATA_TYPE_MISMATCH,
530530
new Object[]{
531531
"java.sql.Types=" + columnType, "java.sql.Types=" + functionReturnType });
532532
result.close ();

src/interfaces/jdbc/org/postgresql/util/PSQLException.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright (c) 2003, PostgreSQL Global Development Group
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/util/PSQLException.java,v 1.14 2003/11/29 19:52:11 pgsql Exp $
10+
* $PostgreSQL: pgsql/src/interfaces/jdbc/org/postgresql/util/PSQLException.java,v 1.15 2003/12/12 18:36:20 davec Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -224,6 +224,8 @@ public String getMessage()
224224

225225
public String getSQLState()
226226
{
227+
if (state == null)
228+
return PSQLState.UNKNOWN_STATE.getState();
227229
return state.getState();
228230
}
229231
}

0 commit comments

Comments
 (0)