wood burning stoves*
The moose likes JDBC and the fly likes MS SQL COnnectivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MS SQL COnnectivity " Watch "MS SQL COnnectivity " New topic
Author

MS SQL COnnectivity

mahant Awati
Greenhorn

Joined: Jan 16, 2012
Posts: 5
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Oct 27, 2005
Posts: 19684
    
  20

And please, KeepItDown. No need to shout.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ujjawal rohra
Ranch Hand

Joined: Mar 20, 2010
Posts: 105
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


SCJP 6
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19684
    
  20

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
 
subject: MS SQL COnnectivity