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

Commit960c186

Browse files
committed
the bug was not fixed in the snapshot of November 5th. Also the enterprise
edition of the driver did not compile. I have fixed both issues again. I haveattached the modified files to this email, maybe you can check them into therepository. (Fixes are marked with //FIXME). Enterprise edition driver nowcompiles and seems to work.Jan Thomae
1 parenta210023 commit960c186

File tree

2 files changed

+43
-15
lines changed

2 files changed

+43
-15
lines changed

‎src/interfaces/jdbc/org/postgresql/PostgresqlDataSource.java

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*
4141
* Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
4242
*
43-
* $Id: PostgresqlDataSource.java,v 1.1 2000/10/12 08:55:24 peter Exp $
43+
* $Id: PostgresqlDataSource.java,v 1.2 2000/11/10 22:06:26 momjian Exp $
4444
*/
4545

4646

@@ -64,9 +64,12 @@
6464
importjavax.naming.Name;
6565
importjavax.naming.NamingException;
6666
importjavax.naming.spi.ObjectFactory;
67-
importpostgresql.util.PSQLException;
68-
importpostgresql.xa.XADataSourceImpl;
69-
67+
// FIXME
68+
//import postgresql.util.PSQLException;
69+
//import postgresql.xa.XADataSourceImpl;
70+
importorg.postgresql.util.PSQLException;
71+
importorg.postgresql.xa.XADataSourceImpl;
72+
//---------
7073

7174
/**
7275
* Implements a JDBC 2.0 {@link javax.sql.DataSource} for the
@@ -191,8 +194,10 @@ public class PostgresqlDataSource
191194
* Each datasource maintains it's own driver, in case of
192195
* driver-specific setup (e.g. pools, log writer).
193196
*/
194-
privatetransientpostgresql.Driver_driver;
195-
197+
// FIXME
198+
// private transient postgresql.Driver _driver;
199+
privatetransientorg.postgresql.Driver_driver;
200+
//---------
196201

197202

198203

@@ -223,8 +228,15 @@ public synchronized Connection getConnection( String user, String password )
223228
// Constructs a driver for use just by this data source
224229
// which will produce TwoPhaseConnection-s. This driver
225230
// is not registered with the driver manager.
226-
_driver =newpostgresql.Driver();
227-
_driver.setLogWriter(_logWriter );
231+
// FIXME
232+
//_driver = new postgresql.Driver();
233+
_driver =neworg.postgresql.Driver();
234+
//-----------
235+
236+
//FIXME
237+
//_driver.setLogWriter( _logWriter );
238+
// Method seems to be unavailable. Just commented it out.
239+
//----------
228240
}catch (SQLExceptionexcept ) {
229241
if (_logWriter !=null )
230242
_logWriter.println("DataSource: Failed to initialize JDBC driver: " +except );
@@ -260,7 +272,10 @@ public synchronized Connection getConnection( String user, String password )
260272
// attempt or a failure.
261273
try {
262274
conn =_driver.connect(url,info );
263-
if ( ! (conninstanceofpostgresql.jdbc2.Connection ) ) {
275+
// FIXME
276+
// if ( ! ( conn instanceof postgresql.jdbc2.Connection ) ) {
277+
if ( ! (conninstanceoforg.postgresql.jdbc2.Connection ) ) {
278+
//--------
264279
if (_logWriter !=null )
265280
_logWriter.println("DataSource: JDBC 1 connections not supported" );
266281
thrownewPSQLException("postgresql.ds.onlyjdbc2" );
@@ -289,7 +304,10 @@ public synchronized void setLogWriter( PrintWriter writer )
289304
// synchronizing.
290305
if (writer !=null ) {
291306
if (_driver !=null )
292-
_driver.setLogWriter(writer );
307+
// FIXME
308+
//_driver.setLogWriter( writer );
309+
// Method seems to be unavailable. Commented it out.
310+
//----------
293311
_logWriter =writer;
294312
}
295313
}

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,20 @@ public Timestamp getTimestamp(int columnIndex) throws SQLException
468468
// This works, but it's commented out because Michael Stephenson's
469469
// solution is better still:
470470
//SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
471-
472-
// Michael Stephenson's solution:
471+
// Modification by Jan Thomae
472+
Stringsub =s.substring(s.length() -3,s.length()-2);
473+
if (sub.equals("+") ||sub.equals("-")) {
474+
s =s.substring(0,s.length()-3) +"GMT"+s.substring(s.length()-3,s.length())+":00";
475+
}
476+
// -------
477+
// Michael Stephenson's solution:
473478
SimpleDateFormatdf =null;
479+
480+
// Modification by Jan Thomae
481+
if (s.length()>27) {
482+
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz");
483+
}else
484+
// -------
474485
if (s.length()>21 &&s.indexOf('.') != -1) {
475486
df =newSimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSzzz");
476487
}elseif (s.length()>19 &&s.indexOf('.') == -1) {
@@ -839,14 +850,14 @@ public boolean absolute(int index) throws SQLException
839850

840851
//if index<0, count from the end of the result set, but check
841852
//to be sure that it is not beyond the first index
842-
if (index<0){
853+
if (index<0)
843854
if (index>=-rows.size())
844855
internalIndex=rows.size()+index;
845856
else {
846857
beforeFirst();
847858
returnfalse;
848859
}
849-
}else {
860+
850861
//must be the case that index>0,
851862
//find the correct place, assuming that
852863
//the index is not too large
@@ -856,7 +867,6 @@ public boolean absolute(int index) throws SQLException
856867
afterLast();
857868
returnfalse;
858869
}
859-
}
860870

861871
current_row=internalIndex;
862872
this_row = (byte [][])rows.elementAt(internalIndex);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp