? cloudscape.LOG Index: org/postgresql/jdbc1/AbstractJdbc1ResultSet.java =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java,v retrieving revision 1.12 diff -c -p -c -p -r1.12 AbstractJdbc1ResultSet.java *** org/postgresql/jdbc1/AbstractJdbc1ResultSet.java 3 May 2003 20:40:45 -0000 1.12 --- org/postgresql/jdbc1/AbstractJdbc1ResultSet.java 17 Jun 2003 21:42:36 -0000 *************** public abstract class AbstractJdbc1Resul *** 189,194 **** --- 189,207 ---- { try { + switch(fields[columnIndex-1].getSQLType()) + { + case Types.NUMERIC: + case Types.REAL: + case Types.DOUBLE: + case Types.FLOAT: + case Types.DECIMAL: + s = (s.indexOf(".")==-1) ? s : s.substring(0,s.indexOf(".")); + break; + case Types.CHAR: + s = s.trim(); + break; + } return Byte.parseByte(s); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 207,212 **** --- 220,238 ---- { try { + switch(fields[columnIndex-1].getSQLType()) + { + case Types.NUMERIC: + case Types.REAL: + case Types.DOUBLE: + case Types.FLOAT: + case Types.DECIMAL: + s = (s.indexOf(".")==-1) ? s : s.substring(0,s.indexOf(".")); + break; + case Types.CHAR: + s = s.trim(); + break; + } return Short.parseShort(s); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 778,783 **** --- 804,810 ---- { try { + s = s.trim(); return Integer.parseInt(s); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 794,799 **** --- 821,827 ---- { try { + s = s.trim(); return Long.parseLong(s); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 811,816 **** --- 839,845 ---- { try { + s = s.trim(); val = new BigDecimal(s); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 837,842 **** --- 866,872 ---- { try { + s = s.trim(); return Float.valueOf(s).floatValue(); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 853,858 **** --- 883,889 ---- { try { + s = s.trim(); return Double.valueOf(s).doubleValue(); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 871,876 **** --- 902,908 ---- // length > 10: SQL Timestamp, assumes PGDATESTYLE=ISO try { + s = s.trim(); return java.sql.Date.valueOf((s.length() == 10) ? s : s.substring(0, 10)); } catch (NumberFormatException e) *************** public abstract class AbstractJdbc1Resul *** 885,890 **** --- 917,923 ---- return null; // SQL NULL try { + s = s.trim(); if (s.length() == 8) { //value is a time value *************** public abstract class AbstractJdbc1Resul *** 952,957 **** --- 985,991 ---- if (s == null) return null; + s = s.trim(); // We must be synchronized here incase more theads access the ResultSet // bad practice but possible. Anyhow this is to protect sbuf and // SimpleDateFormat objects