Database URL

I need to connect to a sql server 2005 database

This is the URL I am using:
jdbc:jtds:sqlserver://orbsql\gpd_pilot:1261;DatabaseName=OIF;SelectMethod=cursor

with this driver:
net.sourceforge.jtds.jdbc.Driver

Any ideas on how to get this to work? I would never name a sql server like that, but I have to use it.

Thanks.

Any error message?

I can only assume that the name is the problem since you mention it.
Maybe the backslash is interpreted as an escape character. In that case you need to escape the backslash with a backslash.

jdbc:jtds:sqlserver://orbsql\\gpd_pilot:1261;DatabaseName=OIF;SelectMethod=cursor

Hope this helps.

This is the error I got when I added the backslash to the url:

org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Unknown server host name ‘orbsql\gpd_pilot’.
java.sql.SQLException: Unknown server host name ‘orbsql\gpd_pilot’.
java.net.UnknownHostException: orbsql\gpd_pilot

And what error message did you get when you used 1 backslash ?
By the way, why not just use it’s IP addres ?

Hope this helps.

Using the ip address in the url will allow me to attach to the database.

Thanks for your help.

Try the following:

jdbc:jtds:sqlserver://orbsql:1261;DatabaseName=OIF;SelectMethod=cursor;instance=gpd_pilot

jdbc:jtds:sqlserver://orbsql:1261;DatabaseName=OIF;SelectMethod=cursor;instance=gpd_pilot

That works also…

Thanks a lot.