Results 1 to 4 of 4
  1. #1
    illusion1912 is offline Member
    Join Date
    Jan 2009
    Posts
    5
    Rep Power
    0

    Default java.sql.sql exceptin: io exception got minus one from a read call

    mport java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;

    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    public class Jdbc extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");

    Connection con = DriverManager.getConnection(
    "jdbcracle:thin:@localhost:8080:abhishek","sco tt ","tiger");
    // @machineNameort:SID, userid, password

    out.println("<HTML>");
    out.println("<HEAD>");
    out.println("<TITLE>Test JDBC Connection</TITLE>");
    out.println("</HEAD>");
    out.println("<BODY>");
    out.println("<H1>Connection Established Successfully</H1>");
    out.println("</BODY>");
    out.println("</HTML>");

    } catch (ClassNotFoundException e1) {
    out.println("Connection Failed " + e1.toString());
    } catch (SQLException e2) {
    out.println("Connection Failed " + e2.toString());
    } catch (Exception e3) {
    out.println("Connection Failed " + e3.toString());
    }
    }

    }
    this is my code. My Sid is abhishek. am using oracle 9i.apache tomcat application server.But the problem i am facing is i am getting "Connection Failed java.sql.SQLException: Io exception: Got minus one from a read call "... Please help!!!!

  2. #2
    racerxadam is offline Member
    Join Date
    Jul 2008
    Posts
    68
    Rep Power
    0

    Default

    Post the whole exception

  3. #3
    illusion1912 is offline Member
    Join Date
    Jan 2009
    Posts
    5
    Rep Power
    0

    Default

    ava.sql.SQLException: Io exception: Got minus one from a read call
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleC onnection.java)
    at oracle.jdbc.driver.OracleDriver.getConnectionInsta nce(OracleDriver.java)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriv er.java)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at Jdbc.doGet(Jdbc.java:20)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:627)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:875)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Unknown Source)....


    This is the exception stack trace that i get.. Please help

  4. #4
    neeraj.singh is offline Member
    Join Date
    Feb 2009
    Location
    Delhi
    Posts
    63
    Rep Power
    0

    Default

    dude,
    check your connection string..
    i think the problem is there

Similar Threads

  1. how to call dll from java ??
    By Omarero in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 05:14 AM
  2. Replies: 5
    Last Post: 10-17-2008, 02:13 PM
  3. Exception throws when I read File
    By Juggler in forum New To Java
    Replies: 11
    Last Post: 08-18-2008, 06:09 PM
  4. Call Java Method
    By hussainzim in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 05-15-2008, 07:22 AM
  5. how to call a dll from java
    By katie in forum Advanced Java
    Replies: 3
    Last Post: 12-10-2007, 10:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •