Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31a925c

Browse files
committed
From: Peter T Mount <patches@maidast.demon.co.uk>
Ok, this fixes three things:1. It seems (from tests submitted by two people with JBuilder) that JBuilder expects a responce from ResultSetMetaData.getPrecision() & getScale() when used on non numeric types. This patch makes these methods return 0, instead of throwing an exception.2. Fixes a small bug where getting the postgresql type name returns null.3. Fixes a problem with ResultSet.getObject() where getting it's string value returns null if you case the object as (PGobject), but returns the value if you case it as it's self.
1 parent7eddade commit31a925c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

‎src/interfaces/jdbc/postgresql/Field.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public int getSQLType() throws SQLException
5858
if (result.getColumnCount() !=1 ||result.getTupleCount() !=1)
5959
thrownewSQLException("Unexpected return from query for type");
6060
result.next();
61-
sql_type =getSQLType(result.getString(1));
61+
type_name =result.getString(1);
62+
sql_type =getSQLType(type_name);
6263
result.close();
6364
}
6465
returnsql_type;

‎src/interfaces/jdbc/postgresql/ResultSetMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public int getPrecision(int column) throws SQLException
266266
caseTypes.DOUBLE:
267267
return16;
268268
default:
269-
thrownewSQLException("no precision for non-numeric data types.");
269+
return0;
270270
}
271271
}
272272

@@ -295,7 +295,7 @@ public int getScale(int column) throws SQLException
295295
caseTypes.DOUBLE:
296296
return16;
297297
default:
298-
thrownewSQLException("no scale for non-numeric data types");
298+
return0;
299299
}
300300
}
301301

‎src/interfaces/jdbc/postgresql/util/PGobject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ public Object clone()
9797
*/
9898
publicStringtoString()
9999
{
100-
returnvalue;
100+
returngetValue();
101101
}
102102
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp