8 Replies Latest reply: Feb 16, 2007 4:04 AM by 807596 RSS

    SQLException: Io exception: Got minus one from a read call

    807596
      Hi,

      I get this error from the following code:

      <%@page contentType="text/html; charset=GBK"%>
      <%@ page import="java.sql.*" %>
      <%@ page import="java.io.*" %>

      <%
      Connection conn = null;

      try {
      Class.forName("oracle.jdbc.driver.OracleDriver");
      conn = DriverManager.getConnection(
      "jdbc:oracle:thin:@isshrdev.isservices.co.za:1523:XXCUSTOM",
      "xxcustom",
      "xxcustom");
                
           Statement stmt = conn.createStatement();
           ResultSet rs = stmt.executeQuery("INSERT INTO XXCUSTOM.XX_CUSTOM_MASTER (MASTER_ID, MASTER_CODE, MASTER_DESCRIPTION) VALUES (XXCUSTOM.XX_CUSTOM_MASTER_S.nextval,�MAST_CODE1�,�Test Master Description1�);");     
           }
      catch(SQLException e) {
      out.println("SQLException: " + e.getMessage() + "<BR>");
      while((e = e.getNextException()) != null)
      out.println(e.getMessage() + "<BR>");
      }
      catch(ClassNotFoundException e) {
      out.println("ClassNotFoundException: " + e.getMessage() + "<BR>");
      }
      finally {
      //Clean up resources, close the connection.
      if(conn != null) {
      try {
      conn.close();
      }
      catch (Exception ignored) {}
      }
      }

      %>




      I am using Oracle 9 and jdk 1.4.2.

      I am trying to connect to a database on the lan, and I use ojdbc14.jar.

      I cannot find any other solutions so any advice will be appreciated.