问题描述
我是一名java初学者,近期用netbeans6.5+sqlserver2000开发了一个带有数据库Java的桌面应用程序,该软件经过调试,在我电脑上运行正常。我的初衷是在其他电脑不装sqlserver的情况下,直接从我电脑数据库读取信息。但是当我把这个软件放到其他电脑上的时候,提示如下异常:D:VEdist>java-jarve.jar[TopLinkInfo]:2009.07.2609:53:12.099--ServerSession(1583057)--TopLink,version:OracleTopLinkEssentials-2.0.1(Buildb09d-fcs(12/06/2007))2009-7-2621:53:13org.jdesktop.application.Application$1run严重:Applicationclassve.VEAppfailedtolaunchLocalExceptionStack:Exception[TOPLINK-4002](OracleTopLinkEssentials-2.0.1(Buildb09d-fcs(12/06/2007))):oracle.toplink.essentials.exceptions.DatabaseExceptionInternalException:java.sql.SQLException:[Microsoft][SQLServer2000DriverforJDBC]Errorestablishingsocket.ErrorCode:0atoracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)atoracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)atoracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)atoracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)atoracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)atoracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)atoracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)atve.VEView.initComponents(VEView.java:329)atve.VEView.<init>(VEView.java:44)atve.VEApp.startup(VEApp.java:19)atorg.jdesktop.application.Application$1.run(Application.java:171)atjava.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)atjava.awt.EventQueue.dispatchEvent(EventQueue.java:597)atjava.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)atjava.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)atjava.awt.EventDispatchThread.run(EventDispatchThread.java:122)Causedby:java.sql.SQLException:[Microsoft][SQLServer2000DriverforJDBC]Errorestablishingsocket.atcom.microsoft.jdbc.base.BaseExceptions.createException(UnknownSource)atcom.microsoft.jdbc.base.BaseExceptions.getException(UnknownSource)atcom.microsoft.jdbc.base.BaseExceptions.getException(UnknownSource)atcom.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(UnknownSource)atcom.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(UnknownSource)atcom.microsoft.jdbc.base.BaseConnection.getNewImplConnection(UnknownSource)atcom.microsoft.jdbc.base.BaseConnection.open(UnknownSource)atcom.microsoft.jdbc.base.BaseDriver.connect(UnknownSource)atjava.sql.DriverManager.getConnection(DriverManager.java:582)atjava.sql.DriverManager.getConnection(DriverManager.java:154)atoracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)...20moreExceptioninthread"AWT-EventQueue-0"java.lang.Error:Applicationclassve.VEAppfailedtolaunchatorg.jdesktop.application.Application$1.run(Application.java:177)atjava.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)atjava.awt.EventQueue.dispatchEvent(EventQueue.java:597)atjava.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)atjava.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)atjava.awt.EventDispatchThread.run(EventDispatchThread.java:122)Causedby:Exception[TOPLINK-4002](OracleTopLinkEssentials-2.0.1(Buildb09d-fcs(12/06/2007))):oracle.toplink.essentials.exceptions.DatabaseExceptionInternalException:java.sql.SQLException:[Microsoft][SQLServer2000DriverforJDBC]Errorestablishingsocket.ErrorCode:0atoracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:305)atoracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:102)atoracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:184)atoracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:582)atoracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:280)atoracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:229)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:93)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:126)atoracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:120)atoracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:91)atve.VEView.initComponents(VEView.java:329)atve.VEView.<init>(VEView.java:44)atve.VEApp.startup(VEApp.java:19)atorg.jdesktop.application.Application$1.run(Application.java:171)...8moreCausedby:java.sql.SQLException:[Microsoft][SQLServer2000DriverforJDBC]Errorestablishingsocket.atcom.microsoft.jdbc.base.BaseExceptions.createException(UnknownSource)atcom.microsoft.jdbc.base.BaseExceptions.getException(UnknownSource)atcom.microsoft.jdbc.base.BaseExceptions.getException(UnknownSource)atcom.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(UnknownSource)atcom.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(UnknownSource)atcom.microsoft.jdbc.base.BaseConnection.getNewImplConnection(UnknownSource)atcom.microsoft.jdbc.base.BaseConnection.open(UnknownSource)atcom.microsoft.jdbc.base.BaseDriver.connect(UnknownSource)atjava.sql.DriverManager.getConnection(DriverManager.java:582)atjava.sql.DriverManager.getConnection(DriverManager.java:154)atoracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:100)...20more我用一段数据库连接代码测试了是否能够从他电脑读取我数据库信息,一切正常,只是不明白为什么我编写的这个软件会出现这样的问题。希望有人能够解答,不胜感激!谢谢