extend SakaiBasicDataSource to support setting arbitrary properties

Description

some drivers, like Oracle, do not allow you to set properties on the jdbc url. With the current SakaiBasicDataSource you have to make a code change to wire up special properties. commons-dbcp version 1.3 (which I think isn't quite stable yet) adds the following method to handle this issue:

/**

  • Sets the connection properties passed to driver.connect(...).
    *

  • Format of the string must be [propertyName=property;]*
    *

  • NOTE - The "user" and "password" properties will be added

  • explicitly, so they do not need to be included here.
    *

  • @param connectionProperties the connection properties used to

  • create new connections
    */
    public void setConnectionProperties(String connectionProperties) {

If we move this into our SakaiBasicDataSource people can then set arbitrary properties via the normal sakai.properties route. Like this:

connectionProperties@javax.sql.BaseDataSource=oracle.jdbc.RetainV9LongBindBehavior=true

Environment

None

Test Plan

None

Attachments

1

Activity

Show:

Ian Boston August 28, 2008 at 11:08 AM

Patch applied to kernel thank you.

John Bush August 28, 2008 at 10:54 AM

oops here one against kernel

Ian Boston August 28, 2008 at 10:35 AM

Patch cant be applied patch is giving the following output

x43543:~/Caret/sakai22/sakaidev/kernel ieb$ patch -p0 < SAK-14325.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
-------------------------- |Index: db-impl/ext/src/java/org/apache/commons/dbcp/SakaiBasicDataSource.java

===================================================================

--- db-impl/ext/src/java/org/apache/commons/dbcp/SakaiBasicDataSource.java (revision 10536)

+++ db-impl/ext/src/java/org/apache/commons/dbcp/SakaiBasicDataSource.java (revision 10537)
--------------------------
File to patch: ./api/src/main/java/org/apache/commons/dbcp/SakaiBasicDataSource.java
patching file ./api/src/main/java/org/apache/commons/dbcp/SakaiBasicDataSource.java
patch: **** malformed patch at line 52:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

John Bush August 27, 2008 at 9:21 AM

Here's a patch...

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created August 27, 2008 at 9:19 AM
Updated October 27, 2009 at 1:42 PM
Resolved August 28, 2008 at 11:08 AM