Help me ...! ( JDBC and Oracle)

Help me ...! ( JDBC and Oracle)

Post by ᤱ?? » Sun, 06 Aug 2000 04:00:00



How can do it(JDBC and Oracle connect)
Help me below error message...???
I wish answer ... everybody...

[[ Error message ]]========================
SQLException caught: 20
=========================================

[[ Progrma source ]] =====================

// EX) 9 - 1 : JDBC connect servlets

    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;

    public class DBPhoneLookup extends HttpServlet {

     public void doGet(HttpServletRequest req, HttpServletResponse res)
       throws ServletException, IOException {

Connection con = null;
Statement stmt = null;
ResultSet rs = null;

res.setContentType("text/html");
PrintWriter out = res.getWriter();

try {
  Class.forName("oracle.jdbc.driver.OracleDriver");

  con = DriverManager.getConnection(

"manager");

   stmt = con.createStatement();

  rs = stmt.executeQuery("SELECT ORDER_ID, TOTAL FROM ORDERS");

  out.println("<html><head><title>Phonebook</title></head>");
  out.println("<body>");
  out.println("<ul>");
  while(rs.next()) {
   out.println("<li>" + rs.getString("order_id") + " " +
rs.getString("total"));
  }
  out.println("</ul>");
  out.println("</body></html>");
    }

   catch(ClassNotFoundException e) {
    out.println("Couldn't load database driver: " + e.getMessage());
    }
    catch(SQLException e) {
     out.println("SQLException caught: " + e.getMessage());
    }
   finally {
    try {
         if(con != null) con.close();
    }
    catch(SQLException ignored) { }
           }
        }
     }

 
 
 

1. JDBC Connection to Oracle,help help help

Hi,
At home I am working on a NT machine. I have Oracle 8i and have
beeen working on it for quite some time.  I have the Enterprise
Edition version.

I am trying to connect to Oracle from jdbc.

Afetr the Class.forName, I have the following:

conn = DriverManager.getConnection

"scott", "tiger");

ORACLE is my sid.
But when I run the compiled code, the following error message
comes up:

The Network Adapter could not establish the connection.

It is looking for a Network adapter. I have no network adapter
in my system.

I also tried instead of localhost, 127:0.0.1. It does not work.

PL. do help me.

Thanks

Malab


Reply to this message

2. Change path of BDE-alias at run-time

3. Help with JDBC and ACCESS via JDBC-ODBC bridge

4. Problems with OUTPUT values of stored procedure when xp_sendmail is called

5. JDBC Gurus ....I need help with Loading JDBC Drivers

6. backup/truncate log

7. Please Help: You specified JDBC 1.22 behavior, can't use JDBC 2.0 functions

8. tables, permissions, sequences

9. JDBC, Blob data, Oracle JDBC

10. Oracle Thin JDBC vs JDBC-OCI bridge

11. jdbc:thin vx jdbc:oci8 and oracle.experiment results and question

12. (JDBC, Oracle) Connection problem with JDBC - sqlplus no problem

13. Oracle JDBC Thin Applet + MS IE: SecurityException accessing jdbc.drivers system property