Bug 33452 - sql's getConnection doesn't allow for aribtrary property setting
Summary: sql's getConnection doesn't allow for aribtrary property setting
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: All All
: P3 enhancement with 6 votes (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
Keywords: PatchAvailable
Depends on:
Reported: 2005-02-08 22:16 UTC by eric kascic
Modified: 2009-08-17 08:46 UTC (History)
0 users

Patch to fix the bug (3.94 KB, patch)
2005-09-30 16:26 UTC, Magnus Grimsell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description eric kascic 2005-02-08 22:16:59 UTC
Looking at JDBCTask.getConnection, username/password are the only properties 
considered when creating the connection.  To automate login to oracle AS 
SYSDBA, the "internal_logon" property has to be set.  Further complicating 
matters is that getConnection can't (seemingly) be easily overridden because 
it relies on quite a bit of private book-keeping. 

Although my interest is specifically in the Oracle "internal_logon" property, 
there are presumably other drivers with other properties that might be useful 
to set.  I'd suggest a sub-element to <sql>: <jdbc-property-list> that 
contains <jdbc-property> tags similar to a path structure, and these 
properties are passed to the created connection in getConnection.
Comment 1 Magnus Grimsell 2005-09-30 16:26:16 UTC
Created attachment 16563 [details]
Patch to fix the bug

I've fixed this bug by adding a nested element to specify the connection
properties. The ant script can look something like this:

<sql driver="oracle.jdbc.OracleDriver"
    <property name="internal_logon" value="SYSDBA"/>
  <transaction	src="create_new_user.sql"/>
Comment 2 Wurm Markus 2006-07-17 12:47:56 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Stefan Bodewig 2009-08-17 08:46:20 UTC
svn revision 805014