Hi !
 
Very easy ! Just get  a JDBC-Driver (e.g. from http://www.worldserver.com/mm.mysql/) and do the following:
/* 
 * Register the driver using Class.forName() 
*/
              
Class.forName("org.gjt.mm.mysql.Driver").newInstance()

/*
 * Register the driver via the system properties variable 
 * "jdbc.drivers"
*/ 
             
Properties P = System.getProperties();
P.put("jdbc.drivers", "org.gjt.mm.mysql.Driver");
System.setProperties(P);
 
Connection Conn = null; 
try { 
    Conn = DriverManager.getConnection("jdbc:mysql://hostname:port/db?user=name&password=secret"); 
    } 
    catch (Exception E) { 
        System.out.println("Connection failed : " + E.getMessage()); 
        throw E; 
    }
// The URL string for the getConnection() method has the following format:
// jdbc:mysql://hostname[:port]/database[?extra_param1=value][&extra_param2=value]





// After you have a connection you can create a Statement and execute simple queries:


    Statement Stmt = Conn.createStatement();
    Stmt.executeUpdate("INSERT INTO some_table (col1, col2) VALUES (1,2)");
Bye bye
    Christian Schulz
-----Urspr�ngliche Nachricht-----
Von: Danival Lucas da Silva [mailto:[EMAIL PROTECTED]]
Gesendet: Samstag, 29. Januar 2000 01:18
An: [EMAIL PROTECTED]
Betreff: Apache and MySql

Hey, is there anyone in this list that speak Portuguese?
 
I have just started working on Servlets and want know how to run my servlet in Apache and connet to a MySql database.
Can anyone help me please?
 
I have already Apache 1.3.9 and MySql working perfectly with perl 5
 
thanks

Reply via email to