5 Ответы Последний ответ: 30.06.2008 15:54, автор: 796254

    NL Exception was generated

    843859

      I'm receiving this error message when execute the class below, who may help me? I already search for the solution in google, but without success.

      I also can connect in this server using SQLPLUS*

      ERROR:

      java.sql.SQLException: Io exception: NL Exception was generated         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:273)         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:327)         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:360)         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:150)         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31)         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:595)         at java.sql.DriverManager.getConnection(DriverManager.java:582)         at java.sql.DriverManager.getConnection(DriverManager.java:185)         at fmsreport.FMSReportView.jButtonSheet1ActionPerformed(FMSReportView.java:372)         at fmsreport.FMSReportView.access$800(FMSReportView.java:26)         at fmsreport.FMSReportView$4.actionPerformed(FMSReportView.java:168)         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)         at java.awt.Component.processMouseEvent(Component.java:6041)         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)         at java.awt.Component.processEvent(Component.java:5806)         at java.awt.Container.processEvent(Container.java:2058)         at java.awt.Component.dispatchEventImpl(Component.java:4413)         at java.awt.Container.dispatchEventImpl(Container.java:2116)         at java.awt.Component.dispatchEvent(Component.java:4243)         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)         at java.awt.Container.dispatchEventImpl(Container.java:2102)         at java.awt.Window.dispatchEventImpl(Window.java:2440)         at java.awt.Component.dispatchEvent(Component.java:4243)         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121) BUILD SUCCESSFUL (total time: 13 seconds)

      CLASS:

      private void jButtonSheet1ActionPerformed(java.awt.event.ActionEvent evt) {                                                      // TODO add your handling code here:         Connection connection = null;         try {             // Load the JDBC driver             String driverName = "oracle.jdbc.driver.OracleDriver";             Class.forName(driverName);             // Create a connection to the database             String url = "jdbc:oracle:thin:@(DESCRIPTION=" +                     "(ADDRESS_LIST=" +                     "(ADDRESS=(PROTOCOL=TCP)" +                     "(HOST=X.com)" + " = " +                     "(PORT=1540)" +                     ")" +                     ")" +                     "(CONNECT_DATA=" +                     "(SERVICE_NAME=empac810)" +                     "(SERVER=DEDICATED)" +                     ")" +                     ")";             String username = "x";             String password = "x";             connection = DriverManager.getConnection(url, username, password);             System.out.println("OK!");         } catch (ClassNotFoundException e) {             e.printStackTrace();         // Could not find the database driver         } catch (SQLException e) {             e.printStackTrace();         // Could not connect to the database         }          }