Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MS-SQL database instance connection  RSS feed

Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, currently i am given this db account, lets say ABC\DEF with DEF as the
instance, and i also have the username and password. however, i dun
understand how to connect to that server. below is the code I use. do i set
the url correctly?
String url = "jdbc:microsoft:sqlserver://ABC/DEF:1433";
String username= "eventsappdev" ;
String password= "hardyboys" ;
con = DriverManager.getConnection(url,username,password);
stmt = con.createStatement();
PS: I am using msbase.jar, msutil.jar, mssqlserver.jar from microsoft. Tomcat 4.0.4 and remote MS-SQL db server.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!