Hope the code below helps.  Also if you're using a new version of java (1.2
or above, I believe) make sure you're using the noopt version of the class
files.

    try
      {
      Class.forName("twz1.jdbc.mysql.jdbcMysqlDriver").newInstance();
      }
    catch(Exception e)
      {
      this.errors.add(new String("Unable to load driver. " +
e.getMessage()));
      }

    String url = new String("jdbc:z1MySQL://" + this.host  + ":3306/" +
this.dbRun);
    try
      {
      this.c = DriverManager.getConnection(url, this.user, this.password);
      }
    catch(Exception e2)
      {
      this.errors.add(new String("Unable to get connection to database: " +
e2.toString()));
      }
    }



> -----Original Message-----
> From: Rakesh Raveendran [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 13, 2000 11:59 AM
> To: Mo DeJong; [EMAIL PROTECTED]
> Subject: How can I connect to MySQL using JDBC
>
>
> Hi,
>
>   I am using a type 4 driver for connecting to MySQL database.The Class
> file(driver file) is being detected, but I am not able to connect to the
> database.There are no exceptions being thrown stating that
> connection is not
> being created.Can any body send me some sample code as to how to
> connect. Iam
> using twz1jdbcForMysql driver.
>
> regards,
> Rakesh
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
>
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
>


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to