简体   繁体   中英

jdbc sqlserver url string

I've found this in a software developed by another with j2ee spring_hibernate tomcat_v7 and jre7. the dbURL is written as follow

dburl = "jdbc:sqlserver://remoteip\\local\\local:1433;database=dbname"

what does the double local means? when removed them the link to sql server 2008 doesn't work anymore.

simple answer to this is in the "integratedSecurity=false;" when you want to connect to the database installed in the same machine and by the windows authentication then use "integratedSecurity=true" without login or password while you have to put the dll existant in the auth file in the jre lib directory however if you want to use another machine (remote) this time the integratedSecurity will never work so you will have to choose the sql server connection and then absolutly use "integratedSecurity=false"

String connectionUrl = "jdbc:sqlserver://ServerName\\databaseInstance:1433;databaseName=DBSS;integratedSecurity=false;user=user;password=pass";

you may also open the sql server config manager and set TCP/IP to enabled, the ip adress (IPALL) dynamic to nothing (delete the 0) and the port to 1433 (same as the string connection) and restart the sql server service

you'll probably also need to create a firewall unbound rule for that port.

hope this will help others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM