aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java')
-rw-r--r--src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
index 2be4ddba5ff..0e8b661d232 100644
--- a/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
+++ b/src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java
@@ -144,7 +144,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
//return null;
//return new String(bytes);
if (columnIndex < 1 || columnIndex > fields.length)
- throw new SQLException("Column Index out of range");
+ throw new PSQLException("postgresql.res.colrange");
wasNullFlag = (this_row[columnIndex - 1] == null);
if(wasNullFlag)
return null;
@@ -187,7 +187,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Byte.parseByte(s);
} catch (NumberFormatException e) {
- throw new SQLException("Bad Byte Form: " + s);
+ throw new PSQLException("postgresql.res.badbyte",s);
}
}
return 0; // SQL NULL
@@ -210,7 +210,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Short.parseShort(s);
} catch (NumberFormatException e) {
- throw new SQLException("Bad Short Form: " + s);
+ throw new PSQLException("postgresql.res.badshort",s);
}
}
return 0; // SQL NULL
@@ -233,7 +233,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Integer.parseInt(s);
} catch (NumberFormatException e) {
- throw new SQLException ("Bad Integer Form: " + s);
+ throw new PSQLException ("postgresql.res.badint",s);
}
}
return 0; // SQL NULL
@@ -256,7 +256,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Long.parseLong(s);
} catch (NumberFormatException e) {
- throw new SQLException ("Bad Long Form: " + s);
+ throw new PSQLException ("postgresql.res.badlong",s);
}
}
return 0; // SQL NULL
@@ -279,7 +279,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Float.valueOf(s).floatValue();
} catch (NumberFormatException e) {
- throw new SQLException ("Bad Float Form: " + s);
+ throw new PSQLException ("postgresql.res.badfloat",s);
}
}
return 0; // SQL NULL
@@ -302,7 +302,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
return Double.valueOf(s).doubleValue();
} catch (NumberFormatException e) {
- throw new SQLException ("Bad Double Form: " + s);
+ throw new PSQLException ("postgresql.res.baddouble",s);
}
}
return 0; // SQL NULL
@@ -329,13 +329,13 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
{
val = new BigDecimal(s);
} catch (NumberFormatException e) {
- throw new SQLException ("Bad BigDecimal Form: " + s);
+ throw new PSQLException ("postgresql.res.badbigdec",s);
}
try
{
return val.setScale(scale);
} catch (ArithmeticException e) {
- throw new SQLException ("Bad BigDecimal Form: " + s);
+ throw new PSQLException ("postgresql.res.badbigdec",s);
}
}
return null; // SQL NULL
@@ -359,7 +359,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
public byte[] getBytes(int columnIndex) throws SQLException
{
if (columnIndex < 1 || columnIndex > fields.length)
- throw new SQLException("Column Index out of range");
+ throw new PSQLException("postgresql.res.colrange");
wasNullFlag = (this_row[columnIndex - 1] == null);
// Handle OID's as BLOBS
@@ -392,7 +392,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
try {
return new java.sql.Date(df.parse(s).getTime());
} catch (ParseException e) {
- throw new SQLException("Bad Date Format: at " + e.getErrorOffset() + " in " + s);
+ throw new PSQLException("postgresql.res.baddate",new Integer(e.getErrorOffset()),s);
}
}
@@ -419,7 +419,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
int sec = (s.length() == 5) ? 0 : Integer.parseInt(s.substring(6));
return new Time(hr, min, sec);
} catch (NumberFormatException e) {
- throw new SQLException ("Bad Time Form: " + s);
+ throw new PSQLException ("postgresql.res.badtime",s);
}
}
return null; // SQL NULL
@@ -450,7 +450,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
java.util.Date d = df.parse(s);
return new Timestamp(d.getTime());
} catch (ParseException e) {
- throw new SQLException("Bad Timestamp Format: at " + e.getErrorOffset() + " in " + s);
+ throw new PSQLException("postgresql.res.badtimestamp",new Integer(e.getErrorOffset()),s);
}
}
return null; // SQL NULL
@@ -711,7 +711,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
Field field;
if (columnIndex < 1 || columnIndex > fields.length)
- throw new SQLException("Column index out of range");
+ throw new PSQLException("postgresql.res.colrange");
field = fields[columnIndex - 1];
// some fields can be null, mainly from those returned by MetaData methods
@@ -784,7 +784,7 @@ public class ResultSet extends postgresql.ResultSet implements java.sql.ResultSe
for (i = 0 ; i < fields.length; ++i)
if (fields[i].name.equalsIgnoreCase(columnName))
return (i+1);
- throw new SQLException ("Column name not found");
+ throw new PSQLException ("postgresql.res.colname",columnName);
}
// ** JDBC 2 Extensions **