@@ -62,6 +62,8 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
62
62
protected org .postgresql .jdbc2 .Statement statement ;
63
63
64
64
private StringBuffer sbuf =null ;
65
+ protected byte [][]rowBuffer =null ;
66
+ protected String sqlQuery =null ;
65
67
66
68
/*
67
69
* Create a new ResultSet - Note that we create ResultSets to
@@ -110,12 +112,17 @@ public ResultSet(Connection conn, Field[] fields, Vector tuples, String status,
110
112
*/
111
113
public boolean next ()throws SQLException
112
114
{
113
- if (rows ==null )
114
- throw new PSQLException ("postgresql.con.closed" );
115
+ if (rows ==null )
116
+ throw new PSQLException ("postgresql.con.closed" );
117
+
115
118
116
119
if (++current_row >=rows .size ())
117
120
return false ;
121
+
118
122
this_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 );
119
126
return true ;
120
127
}
121
128
@@ -640,6 +647,35 @@ public InputStream getBinaryStream(String columnName) throws SQLException
640
647
return getBinaryStream (findColumn (columnName ));
641
648
}
642
649
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
+
643
679
/*
644
680
* The first warning reported by calls on this ResultSet is
645
681
* returned. Subsequent ResultSet warnings will be chained
@@ -896,8 +932,13 @@ public boolean first() throws SQLException
896
932
{
897
933
if (rows .size () <=0 )
898
934
return false ;
935
+
899
936
current_row =0 ;
900
937
this_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
+
901
942
return true ;
902
943
}
903
944
@@ -1137,8 +1178,13 @@ public boolean last() throws SQLException
1137
1178
final int rows_size =rows .size ();
1138
1179
if (rows_size <=0 )
1139
1180
return false ;
1181
+
1140
1182
current_row =rows_size -1 ;
1141
1183
this_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
+
1142
1188
return true ;
1143
1189
}
1144
1190
@@ -1159,6 +1205,7 @@ public boolean previous() throws SQLException
1159
1205
if (--current_row <0 )
1160
1206
return false ;
1161
1207
this_row = (byte [][])rows .elementAt (current_row );
1208
+ System .arraycopy (this_row ,0 ,rowBuffer ,0 ,this_row .length );
1162
1209
return true ;
1163
1210
}
1164
1211
@@ -1598,7 +1645,7 @@ public static Time toTime(String s) throws SQLException
1598
1645
/**
1599
1646
* Parse a string and return a timestamp representing its value.
1600
1647
*
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
1602
1649
* string from the ISO format to a format that Java can understand. Java
1603
1650
* expects timezone info as 'GMT+09:00' where as ISO gives '+09'.
1604
1651
* Java also expects fractional seconds to 3 places where postgres
@@ -1625,6 +1672,7 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet)
1625
1672
synchronized (resultSet )
1626
1673
{
1627
1674
SimpleDateFormat df =null ;
1675
+ if (org .postgresql .Driver .logDebug )org .postgresql .Driver .debug ("the data from the DB is " +s );
1628
1676
1629
1677
// If first time, create the buffer, otherwise clear it.
1630
1678
if (resultSet .sbuf ==null )
@@ -1693,7 +1741,7 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet)
1693
1741
}
1694
1742
else if (slen ==19 )
1695
1743
{
1696
- // No tz or fractional second info.
1744
+ // No tz or fractional second info.
1697
1745
// I'm not sure if it is
1698
1746
// possible to have a string in this format, as pg
1699
1747
// should give us tz qualified timestamps back, but it was
@@ -1702,7 +1750,7 @@ else if (slen == 19)
1702
1750
}
1703
1751
else
1704
1752
{
1705
- // We must just have a date. This case is
1753
+ // We must just have a date. This case is
1706
1754
// needed if this method is called on a date
1707
1755
// column
1708
1756
df =new SimpleDateFormat ("yyyy-MM-dd" );
@@ -1711,6 +1759,8 @@ else if (slen == 19)
1711
1759
try
1712
1760
{
1713
1761
// 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
+
1714
1764
return new Timestamp (df .parse (resultSet .sbuf .toString ()).getTime ());
1715
1765
}
1716
1766
catch (ParseException e )
@@ -1719,5 +1769,9 @@ else if (slen == 19)
1719
1769
}
1720
1770
}
1721
1771
}
1772
+
1773
+ public void setSQLQuery (String sqlQuery ) {
1774
+ this .sqlQuery =sqlQuery ;
1775
+ }
1722
1776
}
1723
1777