db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r948211 - in /db/derby/code/branches/10.5: ./ java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
Date Tue, 25 May 2010 21:21:28 GMT
Author: kmarsden
Date: Tue May 25 21:21:28 2010
New Revision: 948211

URL: http://svn.apache.org/viewvc?rev=948211&view=rev
Log:
DERBY-4664 Change Derby internal stored procedures to avoid DriverManager.getConnection("jdbc:default:connection")
as it may be recognized by other Drivers

Port from trunk. Work around for DERBY-4668


Modified:
    db/derby/code/branches/10.5/   (props changed)
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java

Propchange: db/derby/code/branches/10.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 25 21:21:28 2010
@@ -1 +1 @@
-/db/derby/code/trunk:769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,792434,793089,793588,794106,794303,794955,795166,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,829022,832379,833430,835286,881074,881444,882732,884163,887246,892912,897161,901165,901648,901760,903108,911315,915733,916075,916897,918359,921028,927430
+/db/derby/code/trunk:769596,769602,769606,769962,772090,772337,772449,772534,774281,777105,779681,782991,785131,785139,785163,785570,785662,788369,788670,788674,788968,789264,790218,792434,793089,793588,794106,794303,794955,795166,796020,796027,796316,796372,797147,798347,798742,800523,803548,803948,805696,808494,808850,809643,810860,812669,816531,816536,819006,822289,823659,824694,829022,832379,833430,835286,881074,881444,882732,884163,887246,892912,897161,901165,901648,901760,903108,911315,915733,916075,916897,918359,921028,927430,946794

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java?rev=948211&r1=948210&r2=948211&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
(original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/jdbc/LOBStoredProcedure.java
Tue May 25 21:21:28 2010
@@ -23,12 +23,14 @@ package org.apache.derby.impl.jdbc;
 
 import java.sql.Blob;
 import java.sql.Clob;
+import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 
 import org.apache.derby.iapi.jdbc.EngineLOB;
 import org.apache.derby.iapi.reference.Limits;
 import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.jdbc.InternalDriver;
 
 /**
  * Contains the stored procedures that will be used in the
@@ -389,8 +391,16 @@ public class LOBStoredProcedure {
      * @throws SQLException.
      */
     private static EmbedConnection getEmbedConnection() throws SQLException {
-        return (EmbedConnection)DriverManager
-            .getConnection("jdbc:default:connection");
+        //DERBY-4664 Do not use DriverManager("jdbc:default:connection") because
+        // some other product's Driver might hijack our stored procedure.
+        InternalDriver id = InternalDriver.activeDriver();
+        if (id != null) { 
+            EmbedConnection conn = (EmbedConnection) id.connect("jdbc:default:connection",
null);
+            if (conn != null)
+                return conn;
+        }
+        throw Util.noCurrentConnection();
+        
     }
 
     /**



Mime
View raw message