ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Olsen <herol...@alumni.upenn.edu>
Subject Re: SQL task and Microsoft SQL Server 2000
Date Tue, 25 Nov 2003 17:28:23 GMT
What JDBC driver are you using?  I have used the Microsoft JDBC driver 
(download from msdn, SQL Server 2000 Driver for JDBC Service Pack 1) 
with SQL Server 2000 with good results:

<sql
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" 
url="jdbc:microsoft:sqlserver://host:1433;DatabaseName=dbname;SelectMethod=cursor"
userid="sa"
password="pass"
src="data.sql"
/>

Good luck.

Eric Olsen


Robert Rice wrote:
> 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
> 
> 


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


Mime
View raw message