In your code, you are using jdbc-odbc bridge, not any Oracle jdbc driver.

Dennis huang

-----Original Message-----
From: Jyoti Bongarala [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 1 April 2000 0:15
To: [EMAIL PROTECTED]
Subject: JDBC-Oracle 8i


Hi!

I am having a problem with JDBC. I am trying to
connect to database using JDBC driver but I am not
able to . I tried to connect using the JDBC-ODBC
Bridge and it was successful. I am pasting the code
here ...please tell me where I am going wrong.

------------------------------------------------------
public void setData (String content) {


  String qs = "Insert into news2(id,body) values(4,'"
+ content + "');";

  try {
    String url = "jdbc:odbc:192.68.0.4";
        try{
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        }
  catch (ClassNotFoundException ex) {
System.err.println("Cannot find the DB driver
classes.");
    System.err.println(ex); }

    Connection con =
DriverManager.getConnection(url,"gfe_mop","id");

    Statement stmt = con.createStatement();
    stmt.executeQuery(qs);

    con.close();
}
catch (SQLException ex)
{ System.out.println ("SQLException:");
        while (ex != null)
        {
  System.out.println ("SQL: " + qs);
  System.out.println ("SQLState: " +
ex.getSQLState());
        System.out.println ("Message: " + ex.getMessage());
System.out.println ("Vendor: " +        ex.getErrorCode());
        ex = ex.getNextException(); System.out.println ("");
        }
  }


}


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to