Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2003
    Posts
    26

    Unanswered: JDBC on LInux for MySQL

    How can i create JDBC for MySQL Database on Linux Server.

    Please help.




    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320

    Re: JDBC on LInux for MySQL

    Originally posted by Rubal
    How can i create JDBC for MySQL Database on Linux Server.

    Please help.




    Thanks
    Do you mean how to create a jdbc connection to a mysql db
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  3. #3
    Join Date
    Jun 2003
    Posts
    26
    yes exactly..

  4. #4
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Import java.sql.* ;

    String url = "jdbc:mysql://localhost:3306/"; // Your url
    String userId = "youruser";
    String password ="yourpassword";

    Try {
    Class.forName("org.gjt.mm.mysql.Driver") ;
    }
    catch(ClassNotFoundException e) {
    System.err.println(" Erreur de chargement du driver : " + e) ;
    }

    try {
    Connection con = DriverManager.getConnection(url,userId,password) ;
    }
    catch(SQLException sqle) {
    System.err.println(" Erreur lors de la connexion : " + sqle) ;
    }
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

  5. #5
    Join Date
    Jun 2003
    Posts
    26
    but how to install jdbc driver on linux machine for my sql .......... ??????????????

  6. #6
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Originally posted by Rubal
    but how to install jdbc driver on linux machine for my sql .......... ??????????????
    Depending on what you whant do you can place into your your classpath path that can be java runtime home /lib/ext
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

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