2016-05-17 39 views
0

問題信息在這裏;如何解決在java中連接數據庫的網絡協議錯誤(SQLNonTransient)

Java.sql.SQLNonTransientConnectionException: A network protocol error was encountered and the connection has been terminated:The requested command encountered an unarchitected and implementation-specific condition for which there was no architected message (additional information may be available in the derby.log file on the server). 

而且我看着德比日誌。它說,訪問被拒絕的德比文件

ava.sql.SQLNonTransientConnectionException: A network protocol error was encountered and the connection has been terminated: The requested command encountered an unarchitected and implementation-specific condition for which there was no architected message (additional information may be available in the derby.log file on the server). 
at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source) 
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) 
at org.apache.derby.client.am.ClientStatement.executeQuery(Unknown Source) 
at habersitesihabertakibi.SQLCommand.select(SQLCommand.java:43) 
at habersitesihabertakibi.Site.getKullaniciSayisi(Site.java:423) 
at habersitesihabertakibi.GirisPaneli.<init>(GirisPaneli.java:36) 
at habersitesihabertakibi.GirisPaneli$3.run(GirisPaneli.java:234) 
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) 
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) 
at java.awt.EventQueue.access$500(EventQueue.java:97) 
at java.awt.EventQueue$3.run(EventQueue.java:709) 
at java.awt.EventQueue$3.run(EventQueue.java:703) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) 
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) 
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) 
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) 
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) 
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) 
Caused by: ERROR 08006: A network protocol error was encountered and the connection has been terminated: The requested command encountered an unarchitected and implementation-specific condition for which there was no architected message (additional information may be available in the derby.log file on the server). 
    at org.apache.derby.client.net.NetConnectionReply.parseCMDCHKRM(Unknown Source) 
    at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source) 
    at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source) 
    at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source) 
    at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source) 
    at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source) 
    at 

org.apache.derby.client.am.ClientStatement.readPrepareDescribeOutput(Unknown Source) 
    at org.apache.derby.client.am.ClientStatement.flowExecute(Unknown Source) 
    at org.apache.derby.client.am.ClientStatement.executeQueryX(Unknown Source) 
    ... 19 more 
Caused by: ERROR XSDG3: DERBY SQL error: ERRORCODE: 45000, SQLSTATE: XSDG3, SQLERRMC: Meta-data for unknown could not be accessed to read C:\Users\bilal.harmansa\.netbeans-derby\habersitesitakibi\seg0\c860.dat::SQLSTATE: XJ001 
... 28 more 

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException 
    at habersitesihabertakibi.Site.getKullaniciSayisi(Site.java:426) 
    at habersitesihabertakibi.GirisPaneli.<init>(GirisPaneli.java:36) 
    at habersitesihabertakibi.GirisPaneli$3.run(GirisPaneli.java:234) 
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) 
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) 
    at java.awt.EventQueue.access$500(EventQueue.java:97) 
    at java.awt.EventQueue$3.run(EventQueue.java:709) 
    at java.awt.EventQueue$3.run(EventQueue.java:703) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) 
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) 
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) 
    at 

java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) 
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(E 

ventDispatchThread.java:105) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) 
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) 
BUILD STOPPED (total time: 5 minutes 1 second) 

所以,球員我可以連接到數據庫,我的意思是我點擊連接一個,它似乎我像連接,我可以看到表,但我不能對數據庫視圖DATAS。我在互聯網上搜索了一段時間,但仍然是我找不到解決方案。 2天前我更新netbeans,然後它開始不工作:)

回答

0

我做了一些,現在它的作品。我不知道爲什麼,但我會告訴你我做了什麼。

首先我的NetBeans

Ç我的數據庫文件的路徑:\用戶\ bilal.harmansa.netbeans德比

之後,我複製到「的.netbeans德比」到d:\後我在NetBeans改變路徑(NetBeans的>服務> JavaDB之外點擊右鍵屬性>數據庫位置

我改變d:。\的.netbeans德比

我關閉NetBeans和再次打開它,我試圖連接它給我一些紅線,但它連接,我可以我的數據。之後,我去了原來的路徑,這是 C:\ Users \ bilal.harmansa.netbeans-derby

我刪除了.netbeans-derby。之後我複製了驅動程序D:\中的.netbeans-derby,並粘貼到

C:\ Users \ bilal.harmansa \。

最後去了NetBeans和設置數據庫位置爲原(我們改變了它作爲d:的.netbeans德比)。它應該是

C:\用戶\ bilal.harmansa.netbeans德比

再次。

就是這樣。如果你有同樣的問題,現在可能會有效。我的意思是說不能讀取拒絕訪問的文件原因。我希望你能解決你的問題:)

相關問題