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.
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" url="${ora.jdbc.url}" userid="sys" password="sys" rdbms="oracle"> <connectionproperties> <property name="internal_logon" value="SYSDBA"/> </connectionproperties> <transaction src="create_new_user.sql"/> </sql>
*** This bug has been confirmed by popular vote. ***
svn revision 805014