Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

1 view
Skip to first unread message

Tom

unread,
Aug 13, 2003, 2:57:10 PM8/13/03
to
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)

Frank Stephan

unread,
Aug 13, 2003, 3:06:15 PM8/13/03
to
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


Roedy Green

unread,
Aug 13, 2003, 4:48:34 PM8/13/03
to
On 13 Aug 2003 11:57:10 -0700, Tstal...@yahoo.com (Tom) wrote or
quoted :

>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.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Dave Miller

unread,
Aug 13, 2003, 5:07:11 PM8/13/03
to
In article <c1f60ca7.03081...@posting.google.com>,
Tstal...@yahoo.com says...

> 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.

Tom

unread,
Aug 15, 2003, 10:36:09 AM8/15/03
to
OKay, Thanks ill give it a try.
Thanks for your time and help.
Ill put my code up next time as well =)

Dave Miller <unk...@unknown.com> wrote in message news:<MPG.19a4727a6...@news.pa.comcast.giganews.com>...

0 new messages