Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9cdf723

Browse files
committed
Backpatch jdbc2 fixes to jdbc1, ANT fixes, from Peter Eisentraut
1 parent 1292467 commit 9cdf723

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

contrib/retep/build.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
build file to build the donated retep tools packages
44
5-
$Id: build.xml,v 1.4 2001/03/11 11:06:59 petere Exp $
5+
$Id: build.xml,v 1.5 2001/05/16 16:20:51 momjian Exp $
66
77
-->
88

@@ -22,6 +22,11 @@
2222
<available property="xml" classname="org.xml.sax.Parser" />
2323
</target>
2424

25+
<target name="warning" depends="checks" unless="jdk1.2+">
26+
<echo message="WARNING -- contributed retep tools need jdk1.2 or later -- compilation NOT done." />
27+
</target>
28+
29+
2530
<!-- Prepares the build by creating a directory to place the class files -->
2631
<target name="prepare">
2732
<mkdir dir="${dest}" />
@@ -35,7 +40,7 @@
3540
</target>
3641

3742
<!-- Builds the XML Tools -->
38-
<target name="compile" depends="checks,prepare">
43+
<target name="compile" depends="checks,prepare,warning" if="jdk1.2+">
3944
<javac srcdir="${src}" destdir="${dest}">
4045
<include name="${package}/**" />
4146
</javac>

src/interfaces/jdbc/build.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
build file to allow ant (http://jakarta.apache.org/ant/) to be used
44
to build the PostgreSQL JDBC Driver.
55
6-
$Id: build.xml,v 1.8 2001/03/11 11:07:00 petere Exp $
6+
$Id: build.xml,v 1.9 2001/05/16 16:20:52 momjian Exp $
77
88
-->
99

@@ -120,6 +120,7 @@
120120
<javac srcdir="${src}" destdir="${dest}">
121121
<include name="example/**" />
122122
<exclude name="example/corba/**"/>
123+
<exclude name="example/blobtest.java" unless="jdk1.2+" />
123124
</javac>
124125
</target>
125126

src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public byte getByte(int columnIndex) throws SQLException
227227
*/
228228
public short getShort(int columnIndex) throws SQLException
229229
{
230-
String s = getString(columnIndex);
230+
String s = getFixedString(columnIndex);
231231

232232
if (s != null)
233233
{
@@ -250,7 +250,7 @@ public short getShort(int columnIndex) throws SQLException
250250
*/
251251
public int getInt(int columnIndex) throws SQLException
252252
{
253-
String s = getString(columnIndex);
253+
String s = getFixedString(columnIndex);
254254

255255
if (s != null)
256256
{
@@ -273,7 +273,7 @@ public int getInt(int columnIndex) throws SQLException
273273
*/
274274
public long getLong(int columnIndex) throws SQLException
275275
{
276-
String s = getString(columnIndex);
276+
String s = getFixedString(columnIndex);
277277

278278
if (s != null)
279279
{
@@ -296,7 +296,7 @@ public long getLong(int columnIndex) throws SQLException
296296
*/
297297
public float getFloat(int columnIndex) throws SQLException
298298
{
299-
String s = getString(columnIndex);
299+
String s = getFixedString(columnIndex);
300300

301301
if (s != null)
302302
{
@@ -319,7 +319,7 @@ public float getFloat(int columnIndex) throws SQLException
319319
*/
320320
public double getDouble(int columnIndex) throws SQLException
321321
{
322-
String s = getString(columnIndex);
322+
String s = getFixedString(columnIndex);
323323

324324
if (s != null)
325325
{
@@ -344,7 +344,7 @@ public double getDouble(int columnIndex) throws SQLException
344344
*/
345345
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
346346
{
347-
String s = getString(columnIndex);
347+
String s = getFixedString(columnIndex);
348348
BigDecimal val;
349349

350350
if (s != null)
@@ -412,12 +412,7 @@ public java.sql.Date getDate(int columnIndex) throws SQLException
412412
String s = getString(columnIndex);
413413
if(s==null)
414414
return null;
415-
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
416-
try {
417-
return new java.sql.Date(df.parse(s).getTime());
418-
} catch (ParseException e) {
419-
throw new PSQLException("postgresql.res.baddate",new Integer(e.getErrorOffset()),s);
420-
}
415+
return java.sql.Date.valueOf(s);
421416
}
422417

423418
/**

src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @see java.sql.Statement
2323
* @see ResultSet
2424
*/
25-
public class Statement implements java.sql.Statement
25+
public class Statement extends org.postgresql.Statement implements java.sql.Statement
2626
{
2727
Connection connection; // The connection who created us
2828
java.sql.ResultSet result = null; // The current results

0 commit comments

Comments
 (0)