Problem with JDBC socket, i would greatly appreciate some advice =)

T

Tom

Hi everyone,
Okay im a student so dont laugh at me =)
I have this project going where im trying to connect to my sql server
on my local computer.
I get this error, is this a code problem or is this something that
needs
to be changed possibly in my enviormental variables?
Thanks for the help guys, the error i have is below.



java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown
Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at BookProject.CloudscapeDataAccess.connect(CloudscapeDataAccess.java:134)
at BookProject.CloudscapeDataAccess.<init>(CloudscapeDataAccess.java:44)
at BookProject.AddressBook.<init>(AddressBook.java:35)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:582)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:511)
at sun.applet.AppletPanel.run(AppletPanel.java:289)
at java.lang.Thread.run(Thread.java:479)
java.security.AccessControlException: access denied
(java.lang.RuntimePermission exitVM)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:267)
at java.security.AccessController.checkPermission(AccessController.java:394)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
at java.lang.SecurityManager.checkExit(SecurityManager.java:760)
at java.lang.Runtime.exit(Runtime.java:86)
at java.lang.System.exit(System.java:696)
at BookProject.AddressBook.<init>(AddressBook.java:43)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:582)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:511)
at sun.applet.AppletPanel.run(AppletPanel.java:289)
at java.lang.Thread.run(Thread.java:479)
 
F

Frank Stephan

Hi,

I am not sure, but it seems as if there is no SQL Server running on port
1433 on your machine.

For more advice post some of your code.

Frank
 
R

Roedy Green

Okay im a student so dont laugh at me =)
I have this project going where im trying to connect to my sql server
on my local computer.
I get this error, is this a code problem or is this something that
needs
to be changed possibly in my enviormental variables?
Thanks for the help guys, the error i have is below.

I'm not familiar with SQL Server. But in Sybase, it comes with a
utility that lets you talk to the SQL server via a command line. You
can enter SQL queries and receive results. If there is such a beast
with SQL server, try it out. Make sure you your database is alive and
kicking before you try to hook into it with Java.


There may something you have to do in the control panel to make the
database visible. You may need an ODBC-JDBC connection.
 
T

Tom

OKay, Thanks ill give it a try.
Thanks for your time and help.
Ill put my code up next time as well =)



Dave Miller said:
Hi everyone,
Okay im a student so dont laugh at me =)
I have this project going where im trying to connect to my sql server
on my local computer.
I get this error, is this a code problem or is this something that
needs
to be changed possibly in my enviormental variables?
Thanks for the help guys, the error i have is below.
This line says "Driver can't get socket".
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown
This line says "You aren't following security protocol"
java.security.AccessControlException: access denied
(java.lang.RuntimePermission exitVM)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:267)
at java.security.AccessController.checkPermission(AccessController.java:394)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:540)
at java.lang.SecurityManager.checkExit(SecurityManager.java:760)
at java.lang.Runtime.exit(Runtime.java:86)
at java.lang.System.exit(System.java:696)
This line says "Start looking for the problem at line 43 of your code"
at BookProject.AddressBook.<init>(AddressBook.java:43)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:582)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:511)
at sun.applet.AppletPanel.run(AppletPanel.java:289)
at java.lang.Thread.run(Thread.java:479)
Just a guess, but it sounds like the code dosn't have sockets
permissions - is it an applet? If so, use policytool to grant it
permission.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top