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

Commitad88ee1

Browse files
author
Dave Cramer
committed
changed some commented out messages to use the Driver.debug and fixed first to read the underlying data into rowbuffer
1 parent3f85760 commitad88ee1

File tree

1 file changed

+59
-5
lines changed

1 file changed

+59
-5
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
6262
protectedorg.postgresql.jdbc2.Statementstatement;
6363

6464
privateStringBuffersbuf =null;
65+
protectedbyte[][]rowBuffer=null;
66+
protectedStringsqlQuery=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
*/
111113
publicbooleannext()throwsSQLException
112114
{
113-
if (rows ==null)
114-
thrownewPSQLException("postgresql.con.closed");
115+
if (rows ==null)
116+
thrownewPSQLException("postgresql.con.closed");
117+
115118

116119
if (++current_row >=rows.size())
117120
returnfalse;
121+
118122
this_row = (byte [][])rows.elementAt(current_row);
123+
124+
rowBuffer=newbyte[this_row.length][];
125+
System.arraycopy(this_row,0,rowBuffer,0,this_row.length);
119126
returntrue;
120127
}
121128

@@ -640,6 +647,35 @@ public InputStream getBinaryStream(String columnName) throws SQLException
640647
returngetBinaryStream(findColumn(columnName));
641648
}
642649

650+
publicjava.net.URLgetURL(intcolumnIndex)throwsSQLException
651+
{
652+
returnnull;
653+
}
654+
655+
publicjava.net.URLgetURL(StringcolumnName)throwsSQLException
656+
{
657+
returnnull;
658+
659+
}
660+
661+
publicvoidupdateRef(intcolIndex,java.sql.Refref)throwsSQLException {
662+
663+
}
664+
publicvoidupdateRef(StringcolName,java.sql.Refref)throwsSQLException {
665+
}
666+
publicvoidupdateBlob(intcolIndex,java.sql.Blobblob)throwsSQLException {
667+
}
668+
publicvoidupdateBlob(StringcolName,java.sql.Blobblob)throwsSQLException {
669+
}
670+
publicvoidupdateClob(intcolIndex,java.sql.Clobclob)throwsSQLException {
671+
}
672+
publicvoidupdateClob(StringcolName,java.sql.Clobclob)throwsSQLException {
673+
}
674+
publicvoidupdateArray(intcolIndex,java.sql.Arrayarray)throwsSQLException {
675+
}
676+
publicvoidupdateArray(StringcolName,java.sql.Arrayarray)throwsSQLException {
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
{
897933
if (rows.size() <=0)
898934
returnfalse;
935+
899936
current_row =0;
900937
this_row = (byte [][])rows.elementAt(current_row);
938+
939+
rowBuffer=newbyte[this_row.length][];
940+
System.arraycopy(this_row,0,rowBuffer,0,this_row.length);
941+
901942
returntrue;
902943
}
903944

@@ -1137,8 +1178,13 @@ public boolean last() throws SQLException
11371178
finalintrows_size =rows.size();
11381179
if (rows_size <=0)
11391180
returnfalse;
1181+
11401182
current_row =rows_size -1;
11411183
this_row = (byte [][])rows.elementAt(current_row);
1184+
1185+
rowBuffer=newbyte[this_row.length][];
1186+
System.arraycopy(this_row,0,rowBuffer,0,this_row.length);
1187+
11421188
returntrue;
11431189
}
11441190

@@ -1159,6 +1205,7 @@ public boolean previous() throws SQLException
11591205
if (--current_row <0)
11601206
returnfalse;
11611207
this_row = (byte [][])rows.elementAt(current_row);
1208+
System.arraycopy(this_row,0,rowBuffer,0,this_row.length);
11621209
returntrue;
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)
16251672
synchronized (resultSet)
16261673
{
16271674
SimpleDateFormatdf =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.
16301678
if (resultSet.sbuf ==null)
@@ -1693,7 +1741,7 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet)
16931741
}
16941742
elseif (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
}
17031751
else
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
17081756
df =newSimpleDateFormat("yyyy-MM-dd");
@@ -1711,6 +1759,8 @@ else if (slen == 19)
17111759
try
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+
17141764
returnnewTimestamp(df.parse(resultSet.sbuf.toString()).getTime());
17151765
}
17161766
catch (ParseExceptione)
@@ -1719,5 +1769,9 @@ else if (slen == 19)
17191769
}
17201770
}
17211771
}
1772+
1773+
publicvoidsetSQLQuery(StringsqlQuery) {
1774+
this.sqlQuery=sqlQuery;
1775+
}
17221776
}
17231777

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp