Ant Sql Task with SYSDBA

When connecting to oracle the syntax is CONNECT username/password@url

The equvalent sql task for ant is

<sql driver=”oracle.jdbc.driver.OracleDriver” url=”url” userid=”username” password=”password”>

However when one wants to connect as the sysdba one has to use CONNECT username/password@url as sysdba

Using the sys username and password int the ant task throws theexception.

java.sql.SQLExpection: connection to sys should be as sysdba or sysoper

The ant task can stil be used however. To overcome this you need to use:

<sql driver=”oracle.jdbc.driver.OracleDriver” url=”url” userid=”username as sysdba” password=”password”>

Advertisements

4 responses to “Ant Sql Task with SYSDBA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: