ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Rice <rob...@windermere.com>
Subject SQL task and Microsoft SQL Server 2000
Date Tue, 25 Nov 2003 16:23:59 GMT
I'm trying to utilize the SQL task to connect to Microsoft SQL Server 
2000.  Anybody been able to do this?

The task takes on the form of:
<sql
    driver="org.database.jdbcDriver"
    url="jdbc:database-url"
    userid="sa"
    password="pass"
    src="data.sql"
/>

Where you are required to specify driver, url, userid and password.  In my 
case, I need to also specify the databaseName.  I've tried to create a url 
that contains the databaseName, but have thus far been unsuccessful.

I'm guessing that the sql task uses the following DriverManager method 
signature to create a database connection.
public static Connection getConnection(String url,
                                       String user,
                                       String password)
                                throws SQLException

I've been useing an alternate form programmatically, to successfully 
connect to SQL Server 2000.
public static Connection getConnection(String url,
                                       Properties info)
                                throws SQLException

In this case, I build a Properties object with user, password and 
databaseName.

Possibly the sql task could be extended to accept a variable length list 
of db specific parameters, used to construct a Properties object.  This 
would be useful in any case.

But for now, maybe there is a simpler way that I am overlooking.

Thanks,
Robert Rice


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message