Author: arminw
Date: Mon May 8 04:03:53 2006
New Revision: 405014
URL: http://svn.apache.org/viewcvs?rev=405014&view=rev
Log:
fix compatibility problems with JDK1.3
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/BlobHandle.java
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/ClobHandle.java
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/BlobHandle.java
URL:
http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/BlobHandle.java?rev=405014&r1=405013&r2=405014&view=diff
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/BlobHandle.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/BlobHandle.java
Mon May 8 04:03:53 2006
@@ -20,7 +20,7 @@
import java.sql.Blob;
import java.sql.SQLException;
-import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerInternal;
/**
* This class is a wrapper for [EMAIL PROTECTED] java.sql.Blob} objects.
@@ -31,7 +31,7 @@
{
private Blob blob;
- BlobHandle(PersistenceBroker broker, Blob blob)
+ BlobHandle(PersistenceBrokerInternal broker, Blob blob)
{
super(broker);
this.blob = blob;
@@ -65,51 +65,54 @@
return blob.length();
}
- public void truncate(long len) throws SQLException
+ public byte[] getBytes(long pos, int length) throws SQLException
{
checkActive();
- blob.truncate(len);
+ return blob.getBytes(pos, length);
}
- public byte[] getBytes(long pos, int length) throws SQLException
+ public long position(byte pattern[], long start) throws SQLException
{
checkActive();
- return blob.getBytes(pos, length);
+ return blob.position(pattern, start);
}
- public int setBytes(long pos, byte[] bytes) throws SQLException
+ public InputStream getBinaryStream() throws SQLException
{
checkActive();
- return blob.setBytes(pos, bytes);
+ return blob.getBinaryStream();
}
- public int setBytes(long pos, byte[] bytes, int offset, int len) throws
SQLException
+ public long position(Blob pattern, long start) throws SQLException
{
checkActive();
- return blob.setBytes(pos, bytes, offset, len);
+ return blob.position(pattern, start);
}
+//#ifdef JDBC30
- public long position(byte pattern[], long start) throws SQLException
+ public OutputStream setBinaryStream(long pos) throws SQLException
{
checkActive();
- return blob.position(pattern, start);
+ return blob.setBinaryStream(pos);
}
- public InputStream getBinaryStream() throws SQLException
+ public int setBytes(long pos, byte[] bytes, int offset, int len) throws
SQLException
{
checkActive();
- return blob.getBinaryStream();
+ return blob.setBytes(pos, bytes, offset, len);
}
- public OutputStream setBinaryStream(long pos) throws SQLException
+ public int setBytes(long pos, byte[] bytes) throws SQLException
{
checkActive();
- return blob.setBinaryStream(pos);
+ return blob.setBytes(pos, bytes);
}
- public long position(Blob pattern, long start) throws SQLException
+ public void truncate(long len) throws SQLException
{
checkActive();
- return blob.position(pattern, start);
+ blob.truncate(len);
}
+
+//#endif
}
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/ClobHandle.java
URL:
http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/ClobHandle.java?rev=405014&r1=405013&r2=405014&view=diff
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/ClobHandle.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/lob/ClobHandle.java
Mon May 8 04:03:53 2006
@@ -22,7 +22,7 @@
import java.sql.Clob;
import java.sql.SQLException;
-import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerInternal;
/**
* This class is a wrapper for [EMAIL PROTECTED] java.sql.Clob} objects.
@@ -33,7 +33,7 @@
{
private Clob clob;
- ClobHandle(PersistenceBroker broker, Clob clob)
+ ClobHandle(PersistenceBrokerInternal broker, Clob clob)
{
super(broker);
this.clob = clob;
@@ -67,42 +67,38 @@
return clob.length();
}
- public void truncate(long len) throws SQLException
- {
- checkActive();
- clob.truncate(len);
- }
-
public InputStream getAsciiStream() throws SQLException
{
checkActive();
return clob.getAsciiStream();
}
- public OutputStream setAsciiStream(long pos) throws SQLException
+ public Reader getCharacterStream() throws SQLException
{
checkActive();
- return clob.setAsciiStream(pos);
+ return clob.getCharacterStream();
}
- public Reader getCharacterStream() throws SQLException
+ public String getSubString(long pos, int length) throws SQLException
{
checkActive();
- return clob.getCharacterStream();
+ return clob.getSubString(pos, length);
}
- public Writer setCharacterStream(long pos) throws SQLException
+ public long position(String searchstr, long start) throws SQLException
{
checkActive();
- return clob.setCharacterStream(pos);
+ return clob.position(searchstr, start);
}
- public String getSubString(long pos, int length) throws SQLException
+ public long position(Clob searchstr, long start) throws SQLException
{
checkActive();
- return clob.getSubString(pos, length);
+ return clob.position(searchstr, start);
}
+//#ifdef JDBC30
+
public int setString(long pos, String str) throws SQLException
{
checkActive();
@@ -115,15 +111,23 @@
return clob.setString(pos, str, offset, len);
}
- public long position(String searchstr, long start) throws SQLException
+ public Writer setCharacterStream(long pos) throws SQLException
{
checkActive();
- return clob.position(searchstr, start);
+ return clob.setCharacterStream(pos);
}
- public long position(Clob searchstr, long start) throws SQLException
+ public OutputStream setAsciiStream(long pos) throws SQLException
{
checkActive();
- return clob.position(searchstr, start);
+ return clob.setAsciiStream(pos);
}
+
+ public void truncate(long len) throws SQLException
+ {
+ checkActive();
+ clob.truncate(len);
+ }
+
+//#endif
}
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java
URL:
http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java?rev=405014&r1=405013&r2=405014&view=diff
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/platforms/PlatformDefaultImpl.java
Mon May 8 04:03:53 2006
@@ -590,9 +590,18 @@
{
if(locatorsUpdateCopy == null)
{
+ /*
+ TODO: Seems we have to override this method in each Platform Impl
for proper JDK1.3 support
+ */
try
{
+//#ifdef JDBC30
locatorsUpdateCopy = con.getMetaData().locatorsUpdateCopy() ?
Boolean.TRUE : Boolean.FALSE;
+//#else
+/*
+ locatorsUpdateCopy = Boolean.FALSE;
+*/
+//#endif
}
catch(SQLException e)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]