Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-18 Thread John McNally

Here is a patch that allows dbcp to be compiled under jdk 1.3 and 1.4.

The TesterXXX classes are Lev's noop versions.  I implemented working
versions for the DelegatingXXX classes.  The new methods are surrounded
by comments.

I modified the build system to copy the src to a build directory and
then the comments that hide the code for 1.3 are removed if
java.sql.Savepoint is available.


john mcnally


Lev Assinovsky wrote:
 
 I attached the classes modified for JSK 1.4/JDBC 3.0
 Use it as you want.
 --
 Lev AssinovskyPeterlink Web
 ProgrammerSt. Petersburg, Russia
 Tel/Fax: +7 812 3275343   197022 ul.Chapigina 7Á
 E-mail: [EMAIL PROTECTED]
 
   
   Name: dbcp_jdbc3.0.tar.gz
dbcp_jdbc3.0.tar.gzType: Unix Tape Archive (application/x-tar)
   Encoding: base64
 
   
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

? jdbc3.patch
Index: build.xml
===
RCS file: /home/cvspublic/jakarta-commons/dbcp/build.xml,v
retrieving revision 1.5
diff -u -r1.5 build.xml
--- build.xml   16 Jan 2002 00:19:36 -  1.5
+++ build.xml   18 Mar 2002 09:01:56 -
@@ -59,6 +59,7 @@
   property name=source.src.test value=${source.src}/test/
   property name=source.doc value=${basedir}/doc/
   property name=dest value=${basedir}/dist/
+  property name=dest.src value=${dest}/src/
   property name=dest.classes value=${dest}/classes/
   property name=dest.doc value=${dest}/docs/
   property name=dest.doc.api value=${dest.doc}/api/
@@ -69,6 +70,7 @@
   available property=available-src-java file=${source.src.java}/ !-- does 
this module have java src? --  
   available property=available-src-test file=${source.src.test}/ !-- does 
this module have test src? --  
   available property=jndi.present classname=javax.naming.Context/
+  available property=jdbc3.present classname=java.sql.Savepoint/
 
/target
 
@@ -168,10 +170,31 @@
 
target name=build depends=init,build-java description=compiles source 
files/
 
-   target name=build-java depends=init if=available-src-java
+   target name=copy-src depends=init
+  mkdir dir=${dest.src}/
+
+!-- the source code directory --
+copy todir=${dest.src}/org filtering=yes
+fileset dir=${source.src.java} defaultexcludes=no
+include name=**/*.java/
+include name=**/*.xml/
+include name=**/*.properties/
+include name=**/package.html/
+/fileset
+/copy
+
+   /target
+
+   target name=prepare-jdbc3 if=jdbc3.present
+  replace dir=${dest.src} token=/* JDBC_3_ANT_KEY value= /
+  replace dir=${dest.src} token=JDBC_3_ANT_KEY */ value= /
+   /target
+
+   target name=build-java depends=copy-src, prepare-jdbc3 
+if=available-src-java
   mkdir dir=${dest.classes}/
+
   javac destdir=${dest.classes}
- srcdir=${source.src.java}
+ srcdir=${dest.src}
  classpath=${classpath}
  debug=false
  deprecation=true
@@ -182,9 +205,19 @@
/target
 
target name=build-test depends=init,build-java if=available-src-test
+  mkdir dir=${dest.src}/
+!-- the source code directory --
+copy todir=${dest.src}/org filtering=yes
+fileset dir=${source.src.test} defaultexcludes=no
+include name=**/*.java/
+/fileset
+/copy
+
+  antcall target=prepare-jdbc3 /
+
   mkdir dir=${dest.classes}/
   javac destdir=${dest.classes}
- srcdir=${source.src.test}
+ srcdir=${dest.src}
  classpath=${classpath}
  debug=false
  deprecation=true
Index: src/java/org/apache/commons/dbcp/DelegatingConnection.java
===
RCS file: 
/home/cvspublic/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingConnection.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 DelegatingConnection.java
--- src/java/org/apache/commons/dbcp/DelegatingConnection.java  14 Apr 2001 17:15:17 
-  1.1.1.1
+++ src/java/org/apache/commons/dbcp/DelegatingConnection.java  18 Mar 2002 09:01:56 
+-
@@ -172,4 +172,95 @@
 ((DelegatingConnection)_conn).passivate();
 }
 }
-}
\ No newline at end of file
+
+//  JDBC 3.0 
+/* JDBC_3_ANT_KEY
+
+public void setHoldability(int holdability) throws SQLException
+{
+checkOpen(); 
+_conn.setHoldability(holdability);
+}
+
+public int getHoldability() throws SQLException
+{
+checkOpen(); 
+

Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-18 Thread Lev Assinovsky

John!
Good job!

John McNally wrote:
 
 Here is a patch that allows dbcp to be compiled under jdk 1.3 and 1.4.
 
 The TesterXXX classes are Lev's noop versions.  I implemented working
 versions for the DelegatingXXX classes.  The new methods are surrounded
 by comments.
 
 I modified the build system to copy the src to a build directory and
 then the comments that hide the code for 1.3 are removed if
 java.sql.Savepoint is available.
 
 john mcnally
 
 Lev Assinovsky wrote:
 
  I attached the classes modified for JSK 1.4/JDBC 3.0
  Use it as you want.
  --
  Lev AssinovskyPeterlink Web
  ProgrammerSt. Petersburg, Russia
  Tel/Fax: +7 812 3275343   197022 ul.Chapigina 7Á
  E-mail: [EMAIL PROTECTED]
 

Name: dbcp_jdbc3.0.tar.gz
 dbcp_jdbc3.0.tar.gzType: Unix Tape Archive (application/x-tar)
Encoding: base64
 

  --
  To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
   
 ? jdbc3.patch
 Index: build.xml
 ===
 RCS file: /home/cvspublic/jakarta-commons/dbcp/build.xml,v
 retrieving revision 1.5
 diff -u -r1.5 build.xml
 --- build.xml   16 Jan 2002 00:19:36 -  1.5
 +++ build.xml   18 Mar 2002 09:01:56 -
 @@ -59,6 +59,7 @@
property name=source.src.test value=${source.src}/test/
property name=source.doc value=${basedir}/doc/
property name=dest value=${basedir}/dist/
 +  property name=dest.src value=${dest}/src/
property name=dest.classes value=${dest}/classes/
property name=dest.doc value=${dest}/docs/
property name=dest.doc.api value=${dest.doc}/api/
 @@ -69,6 +70,7 @@
available property=available-src-java file=${source.src.java}/ !-- 
does this module have java src? --
available property=available-src-test file=${source.src.test}/ !-- 
does this module have test src? --
available property=jndi.present classname=javax.naming.Context/
 +  available property=jdbc3.present classname=java.sql.Savepoint/
 
 /target
 
 @@ -168,10 +170,31 @@
 
 target name=build depends=init,build-java description=compiles source 
files/
 
 -   target name=build-java depends=init if=available-src-java
 +   target name=copy-src depends=init
 +  mkdir dir=${dest.src}/
 +
 +!-- the source code directory --
 +copy todir=${dest.src}/org filtering=yes
 +fileset dir=${source.src.java} defaultexcludes=no
 +include name=**/*.java/
 +include name=**/*.xml/
 +include name=**/*.properties/
 +include name=**/package.html/
 +/fileset
 +/copy
 +
 +   /target
 +
 +   target name=prepare-jdbc3 if=jdbc3.present
 +  replace dir=${dest.src} token=/* JDBC_3_ANT_KEY value= /
 +  replace dir=${dest.src} token=JDBC_3_ANT_KEY */ value= /
 +   /target
 +
 +   target name=build-java depends=copy-src, prepare-jdbc3 
if=available-src-java
mkdir dir=${dest.classes}/
 +
javac destdir=${dest.classes}
 - srcdir=${source.src.java}
 + srcdir=${dest.src}
   classpath=${classpath}
   debug=false
   deprecation=true
 @@ -182,9 +205,19 @@
 /target
 
 target name=build-test depends=init,build-java if=available-src-test
 +  mkdir dir=${dest.src}/
 +!-- the source code directory --
 +copy todir=${dest.src}/org filtering=yes
 +fileset dir=${source.src.test} defaultexcludes=no
 +include name=**/*.java/
 +/fileset
 +/copy
 +
 +  antcall target=prepare-jdbc3 /
 +
mkdir dir=${dest.classes}/
javac destdir=${dest.classes}
 - srcdir=${source.src.test}
 + srcdir=${dest.src}
   classpath=${classpath}
   debug=false
   deprecation=true
 Index: src/java/org/apache/commons/dbcp/DelegatingConnection.java
 ===
 RCS file: 
/home/cvspublic/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/DelegatingConnection.java,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 DelegatingConnection.java
 --- src/java/org/apache/commons/dbcp/DelegatingConnection.java  14 Apr 2001 17:15:17 
-  1.1.1.1
 +++ src/java/org/apache/commons/dbcp/DelegatingConnection.java  18 Mar 2002 09:01:56 
-
 @@ -172,4 +172,95 @@
  ((DelegatingConnection)_conn).passivate();
  }
  }
 -}
 \ No newline at end of file
 +
 +//  JDBC 3.0 
 +/* JDBC_3_ANT_KEY
 +
 +public void 

Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-18 Thread Craig R. McClanahan



On Mon, 18 Mar 2002, Lev Assinovsky wrote:

 Date: Mon, 18 Mar 2002 17:02:44 +0300
 From: Lev Assinovsky [EMAIL PROTECTED]
 Reply-To: Jakarta Commons Developers List [EMAIL PROTECTED]
 To: Jakarta Commons Developers List [EMAIL PROTECTED]
 Subject: Re: [dbcp] JDBC 3.0 and JDK 1.4

 John!
 Good job!


I agree ... and I'm planning to integrate the proposed patches unless
someone objects (or someone wants to beat me to it :-).

Craig


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




[dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Lev Assinovsky

Since JDK 1.4 includes JDBC 3.0
I added all additional functions with a body like:
{
  throw new SQLException(Not implemented.);
}
to be able to compile in JDK 1.4.

The following files were modified (in my local box):

./src/java/org/apache/commons/dbcp/DelegatingConnection.java
./src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java
./src/java/org/apache/commons/dbcp/DelegatingStatement.java
./src/test/org/apache/commons/dbcp/TesterConnection.java
./src/test/org/apache/commons/dbcp/TesterPreparedStatement.java
./src/test/org/apache/commons/dbcp/TesterResultSet.java
./src/test/org/apache/commons/dbcp/TesterStatement.java

Now dbcp can be compiled by any JDK.
Do you need these files?

Regards, 
-- 
Lev AssinovskyPeterlink Web
ProgrammerSt. Petersburg, Russia
Tel/Fax: +7 812 3275343   197022 ul.Chapigina 7Á
E-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread otisg

I think this would be a good thing to have in the interim.
I'd suggest you post the patches here and hopefully somebody with commit
priviledges can apply them.

Thanks,
Otis
___
Get your own FREE email account at iVillage.com!
http://webmail.ivillage.com/

-Original Message-

From: Lev Assinovsky
Sent: 3/13/2002 7:45:41 PM
To: [EMAIL PROTECTED]
Subject: [dbcp] JDBC 3.0 and JDK 1.4

Since JDK 1.4 includes JDBC 3.0
I added all additional functions with a body like:
{
throw new SQLException(Not implemented.);
}
to be able to compile in JDK 1.4.

The following files were modified (in my local box):

./src/java/org/apache/commons/dbcp/DelegatingConnection.java
./src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java
./src/java/org/apache/commons/dbcp/DelegatingStatement.java
./src/test/org/apache/commons/dbcp/TesterConnection.java
./src/test/org/apache/commons/dbcp/TesterPreparedStatement.java
./src/test/org/apache/commons/dbcp/TesterResultSet.java
./src/test/org/apache/commons/dbcp/TesterStatement.java

Now dbcp can be compiled by any JDK.
Do you need these files?

Regards, 
-- 
Lev Assinovsky Peterlink Web
Programmer
St. Petersburg, Russia
Tel/Fax: +7 812 3275343 197022 ul.Chapigina 7Á
E-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 





Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Andrus Adamchik

Question: if you added a method

public Savepoint setSavepoint(String name) throws SQLException

how is this going to compile with JSDK 1.3? java.sql.Savepoint was only 
added in 1.4




Lev Assinovsky wrote:
 Since JDK 1.4 includes JDBC 3.0
 I added all additional functions with a body like:
 {
   throw new SQLException(Not implemented.);
 }
 to be able to compile in JDK 1.4.


-- 
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- Andrei (a.k.a. Andrus) Adamchik
Home of Cayenne - O/R Persistence Framework
http://objectstyle.org/cayenne/
email: andrus-jk at objectstyle dot org


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Tomasz Pik



otisg wrote:

 I think this would be a good thing to have in the interim.
 I'd suggest you post the patches here and hopefully somebody with commit
 priviledges can apply them.


Maybe it will be better to produce two versions of package
(JDK 1.4- and JDK 1.4), in the similar to Cactus way
(Servlet API 2.2 and Servlet API 2.3).

Tomek Pik
[EMAIL PROTECTED]


 
 Thanks,
 Otis



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread otisg

Heh, it won't. Where's my coffee...?

Sending the patches may still be goo, to save those with 1.4 some work
doing the same thing to compile DBCP under 1.4.

Otis
___
Get your own FREE email account at iVillage.com!
http://webmail.ivillage.com/

-Original Message-

From: Andrus Adamchik
Sent: 3/13/2002 12:14:24 PM
To: [EMAIL PROTECTED]
Subject: Re: [dbcp] JDBC 3.0 and JDK 1.4

Question: if you added a method

public Savepoint setSavepoint(String name) throws SQLException

how is this going to compile with JSDK 1.3? java.sql.Savepoint was only 
added in 1.4




Lev Assinovsky wrote:
 Since JDK 1.4 includes JDBC 3.0
 I added all additional functions with a body like:
 {
 throw new SQLException(Not implemented.);
 }
 to be able to compile in JDK 1.4.


-- 
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
- Andrei (a.k.a. Andrus) Adamchik
Home of Cayenne - O/R Persistence Framework
http://objectstyle.org/cayenne/
email: andrus-jk at objectstyle dot org


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 





Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Juozas Baliuka

Hi,
Try reflection to generate wrappers .
It is very trivial to implement since JKD1.3 , and I think it is better to
forget JDK1.2
in the next DBCP version.




 otisg wrote:

  I think this would be a good thing to have in the interim.
  I'd suggest you post the patches here and hopefully somebody with commit
  priviledges can apply them.


 Maybe it will be better to produce two versions of package
 (JDK 1.4- and JDK 1.4), in the similar to Cactus way
 (Servlet API 2.2 and Servlet API 2.3).

 Tomek Pik
 [EMAIL PROTECTED]


 
  Thanks,
  Otis



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Lev Assinovsky

Andrus Adamchik wrote:
 
 Question: if you added a method
 
 public Savepoint setSavepoint(String name) throws SQLException
 
 how is this going to compile with JSDK 1.3? java.sql.Savepoint was only
 added in 1.4
 
 Lev Assinovsky wrote:
  Since JDK 1.4 includes JDBC 3.0
  I added all additional functions with a body like:
  {
throw new SQLException(Not implemented.);
  }
  to be able to compile in JDK 1.4.
 
 --
 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 - Andrei (a.k.a. Andrus) Adamchik
 Home of Cayenne - O/R Persistence Framework
 http://objectstyle.org/cayenne/
 email: andrus-jk at objectstyle dot org
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

Wow! You are right!!
Sorry, I didn't think about additional classes!


-- 
Lev AssinovskyPeterlink Web
ProgrammerSt. Petersburg, Russia
Tel/Fax: +7 812 3275343   197022 ul.Chapigina 7Á
E-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [dbcp] JDBC 3.0 and JDK 1.4

2002-03-13 Thread Lev Assinovsky

I attached the classes modified for JSK 1.4/JDBC 3.0
Use it as you want.  
-- 
Lev AssinovskyPeterlink Web
ProgrammerSt. Petersburg, Russia
Tel/Fax: +7 812 3275343   197022 ul.Chapigina 7Á
E-mail: [EMAIL PROTECTED]


dbcp_jdbc3.0.tar.gz
Description: GNU Zip compressed data

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]