Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC Error

Status
Not open for further replies.

rizunb

Programmer
Feb 27, 2003
63
CA
Hey guys
I am running a batch file that is suppose to populate a sql server 2005 database. but when I run it, I get this error.

"unable to connect to data source jdbc:microsoft:sqlserver://cc-rizwan:1433;DatabaseName = ATSDEMO;SELECTMETHOD = CURSOR; JAVA.SQL.SQLEXCEPTION [Microsoft][SQLSERVER 2000 drive for JDBC] error establishing socket

Exception in thread main java.lang.nullpointerexception"

I have installed the jdbc drive for sql server and copied the files over to JRE/lib/ext. I dont understand why its giving me an error. I thing to notice is that it is not asking me for an admin login and password for sql server. Do you think thats why it is giving me that error????

Thanks

Rizz
 
Who and how should you be asked for a login? Databases normally don't send login-windows thru the net.

Instead, you send username and passwort while establishing the connection.

Show us your code to connect.

Did you connect successfully from remote to the database before?
It might be a configuration-setting of the database too, but I don't guess so.

seeking a job as java-programmer in Berlin:
 
Can you telnet to the server on port 1433 ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hey guys
I just tried the command telnet localhost 1433
and it gave me an error saying "could not open connection to the host on port 1433 : connection failed". What should i do now
 
Is the database running ?
Is there a firewall blocking access ?
Is it definitely port 1443 that your db is listening on ?
I would speak to your DBA's if possible.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Yes, the sql server database is running and it is listening to port 1433. I just checked this. I have also turned the firewall off. Still no luck....
 
But if you cannot telnet to the port, then it surely cannot be listening ?
What does "netstat -a" give you - is there a socket listening on 1443 ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
netstat -a" didnt show port 1433 at all. I guess it is not listening... but when i open the networking section of MSSQLSERVER, it shows the db is listening to port 1433. This is strange.....
 
reboot the server I guess, speak to your DBA's.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top