File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MS SQL COnnectivity

 
mahant Awati
Greenhorn
Posts: 6
  • 0
  • 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: 20203
26
MySQL Database
  • 0
  • 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: 20393
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And please, KeepItDown. No need to shout.
 
ujjawal rohra
Ranch Hand
Posts: 105
  • 0
  • 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: 20393
47
Chrome Eclipse IDE Java Windows
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic