@@ -62,6 +62,8 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
6262protected org .postgresql .jdbc2 .Statement statement ;
6363
6464private StringBuffer sbuf =null ;
65+ protected byte [][]rowBuffer =null ;
66+ protected String sqlQuery =null ;
6567
6668/*
6769 * Create a new ResultSet - Note that we create ResultSets to
@@ -110,12 +112,17 @@ public ResultSet(Connection conn, Field[] fields, Vector tuples, String status,
110112 */
111113public boolean next ()throws SQLException
112114{
113- if (rows ==null )
114- throw new PSQLException ("postgresql.con.closed" );
115+ if (rows ==null )
116+ throw new PSQLException ("postgresql.con.closed" );
117+
115118
116119if (++current_row >=rows .size ())
117120return false ;
121+
118122this_row = (byte [][])rows .elementAt (current_row );
123+
124+ rowBuffer =new byte [this_row .length ][];
125+ System .arraycopy (this_row ,0 ,rowBuffer ,0 ,this_row .length );
119126return true ;
120127}
121128
@@ -640,6 +647,35 @@ public InputStream getBinaryStream(String columnName) throws SQLException
640647return getBinaryStream (findColumn (columnName ));
641648}
642649
650+ public java .net .URL getURL (int columnIndex )throws SQLException
651+ {
652+ return null ;
653+ }
654+
655+ public java .net .URL getURL (String columnName )throws SQLException
656+ {
657+ return null ;
658+
659+ }
660+
661+ public void updateRef (int colIndex ,java .sql .Ref ref )throws SQLException {
662+
663+ }
664+ public void updateRef (String colName ,java .sql .Ref ref )throws SQLException {
665+ }
666+ public void updateBlob (int colIndex ,java .sql .Blob blob )throws SQLException {
667+ }
668+ public void updateBlob (String colName ,java .sql .Blob blob )throws SQLException {
669+ }
670+ public void updateClob (int colIndex ,java .sql .Clob clob )throws SQLException {
671+ }
672+ public void updateClob (String colName ,java .sql .Clob clob )throws SQLException {
673+ }
674+ public void updateArray (int colIndex ,java .sql .Array array )throws SQLException {
675+ }
676+ public void updateArray (String colName ,java .sql .Array array )throws SQLException {
677+ }
678+
643679/*
644680 * The first warning reported by calls on this ResultSet is
645681 * returned. Subsequent ResultSet warnings will be chained
@@ -896,8 +932,13 @@ public boolean first() throws SQLException
896932{
897933if (rows .size () <=0 )
898934return false ;
935+
899936current_row =0 ;
900937this_row = (byte [][])rows .elementAt (current_row );
938+
939+ rowBuffer =new byte [this_row .length ][];
940+ System .arraycopy (this_row ,0 ,rowBuffer ,0 ,this_row .length );
941+
901942return true ;
902943}
903944
@@ -1137,8 +1178,13 @@ public boolean last() throws SQLException
11371178final int rows_size =rows .size ();
11381179if (rows_size <=0 )
11391180return false ;
1181+
11401182current_row =rows_size -1 ;
11411183this_row = (byte [][])rows .elementAt (current_row );
1184+
1185+ rowBuffer =new byte [this_row .length ][];
1186+ System .arraycopy (this_row ,0 ,rowBuffer ,0 ,this_row .length );
1187+
11421188return true ;
11431189}
11441190
@@ -1159,6 +1205,7 @@ public boolean previous() throws SQLException
11591205if (--current_row <0 )
11601206return false ;
11611207this_row = (byte [][])rows .elementAt (current_row );
1208+ System .arraycopy (this_row ,0 ,rowBuffer ,0 ,this_row .length );
11621209return true ;
11631210}
11641211
@@ -1598,7 +1645,7 @@ public static Time toTime(String s) throws SQLException
15981645/**
15991646* Parse a string and return a timestamp representing its value.
16001647*
1601- * The driver is set to return ISO date formated strings. We modify this
1648+ * The driver is set to return ISO date formated strings. We modify this
16021649* string from the ISO format to a format that Java can understand. Java
16031650* expects timezone info as 'GMT+09:00' where as ISO gives '+09'.
16041651* Java also expects fractional seconds to 3 places where postgres
@@ -1625,6 +1672,7 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet)
16251672synchronized (resultSet )
16261673{
16271674SimpleDateFormat df =null ;
1675+ if (org .postgresql .Driver .logDebug )org .postgresql .Driver .debug ("the data from the DB is " +s );
16281676
16291677// If first time, create the buffer, otherwise clear it.
16301678if (resultSet .sbuf ==null )
@@ -1693,7 +1741,7 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet)
16931741}
16941742else if (slen ==19 )
16951743{
1696- // No tz or fractional second info.
1744+ // No tz or fractional second info.
16971745// I'm not sure if it is
16981746// possible to have a string in this format, as pg
16991747// should give us tz qualified timestamps back, but it was
@@ -1702,7 +1750,7 @@ else if (slen == 19)
17021750}
17031751else
17041752{
1705- // We must just have a date. This case is
1753+ // We must just have a date. This case is
17061754// needed if this method is called on a date
17071755// column
17081756df =new SimpleDateFormat ("yyyy-MM-dd" );
@@ -1711,6 +1759,8 @@ else if (slen == 19)
17111759try
17121760{
17131761// All that's left is to parse the string and return the ts.
1762+ if (org .postgresql .Driver .logDebug )org .postgresql .Driver .debug ("" +df .parse (resultSet .sbuf .toString ()).getTime () );
1763+
17141764return new Timestamp (df .parse (resultSet .sbuf .toString ()).getTime ());
17151765}
17161766catch (ParseException e )
@@ -1719,5 +1769,9 @@ else if (slen == 19)
17191769}
17201770}
17211771}
1772+
1773+ public void setSQLQuery (String sqlQuery ) {
1774+ this .sqlQuery =sqlQuery ;
1775+ }
17221776}
17231777