the ms jdbc driver, my local sql server 2005 server name is:
DENLAP0059987\SQLEXPRESS,
my java code is following:
...
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
DriverManager.getConnection("jdbc:sqlserver://DENLAP0059987\\SQLEXPRESS;user=sa;password=shangha i");
I got error message:
com.microsoft.sqlserver.jdbc.SQLServerException: Failed
Logon:com.microsoft.sqlserver.jdbc.SQLServerExcept ion: Failed connection to
named instance [sqlexpress] [java.net.SocketTimeoutException: Receive timed
out]
at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:193)
..........
what's wrong with this connection string:
"jdbc:sqlserver://DENLAP0059987\\SQLEXPRESS;user=sa;password=shangha i"
Please advise.
Thanks
steven
the microsoft sql server beta2 jdbc driver still has bugs,but you can
do as follows:
fist Go to configuration Manager/Protocols/TCP IP, and entered a port
number (eg. 5560) as the default port, and for port value in IP1, IP2,
and IP3.
and then just write your jdbc url like this :
DriverManager.getConnection("jdbc:sqlserver://DENLAP0059987:5560;databaseName=MydatabaseName;use r=sa;password=shanghai");
don't care "\SQLEXPRESS",it's no use.
good luck!
BTW:are you lived in shanghai

steven wrote:
> I was not able to connect to local sql server 2005 express database through
> the ms jdbc driver, my local sql server 2005 server name is:
> DENLAP0059987\SQLEXPRESS,
> my java code is following:
> ...
> Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
>
> DriverManager.getConnection("jdbc:sqlserver://DENLAP0059987\\SQLEXPRESS;user=sa;password=shangha i");
>
> I got error message:
>
> com.microsoft.sqlserver.jdbc.SQLServerException: Failed
> Logon:com.microsoft.sqlserver.jdbc.SQLServerExcept ion: Failed connection to
> named instance [sqlexpress] [java.net.SocketTimeoutException: Receive timed
> out]
> at com.microsoft.sqlserver.jdbc.SQLServerDriver.conne ct(Unknown Source)
> at java.sql.DriverManager.getConnection(DriverManager .java:512)
> at java.sql.DriverManager.getConnection(DriverManager .java:193)
> .........
>
> what's wrong with this connection string:
> "jdbc:sqlserver://DENLAP0059987\\SQLEXPRESS;user=sa;password=shangha i"
>
> Please advise.
> Thanks
> steven
No comments:
Post a Comment