This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MS SQL COnnectivity

 
mahant Awati
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I AM TRYING TO CONNECT MS SQL BY USING BELOW JSP CODE. BUT ITS NOT CONNECTING. PLEASE HELP ME OUT.
THANKS & REGARDS MAHANTESH (MAIL ID: <removed> )

 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed your code tags (you didn't do them quite right, so the code came out as text). And I also removed your e-mail address from the post -- it's a really bad idea to post your e-mail address on a public forum. (Read our FAQ link UseTheForumNotEmail for more about that.)

I'm also moving the post to the JDBC forum: I don't see anything Struts-related in it.

And the first thing the people in the JDBC forum are going to say is "Show us the stack trace of the exception that's thrown". So you might want to start by posting that.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please, KeepItDown. No need to shout.
 
ujjawal rohra
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you need to post the stack trace of the problem.
The problem may be at the getConnection() method. No url of the database is specified
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL is indeed incorrect. The format of the URL for MS SQL Server 2000 databases (which you're using, based on the driver and URL given) should be jdbc:microsoft:sqlserver://HOST:PORT for opening the default database, and jdbc:microsoft:sqlserver://HOST:PORT;DatabaseName=DATABASE for any database. The :PORT part can be omitted to use the default port 1433.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic