Hello,

I am using MySql in my  ISP, this is the first time I downladed the big 
guy himself in my machine. It is working fine as stand alone.
My question is , how to use MySql using java programs. I downloaded 
RESIN1.1 and copied the JAR file to the following directory
c:\resin1.1\lib and I added c:\resin1.1\lib; to my CLASS_PATH 
direcotory. I wrote a test program, I am getting driver not found error.
Can any one help me with this one or any other solution that can help me 
use MySql with my java program.

Thanks in advance for the help.


   Connection con = null;
   Statement stmt = null;

   ResultSet rs = null;

   res.setContentType("text/html");

   PrintWriter out = res.getWriter();

   try {

    Class.forName("com.caucho.jdbc.mysql.Driver");

    con = 
DriverManager.getConnection("jdbc:mysql-caucho://localhost:3306/mydb",uid,pwd);

    stmt = con.createStatement();

    rs = stmt.executeQuery("select * from test");

    out.println("Done");
  
   } 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){}
   }


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to