Nella cartella lib ho 2 file:
[list=1][*]jdbc2_0-stdext.jar[*]jta-spec1_0_1.jar[/list=1]
Per quanto riguarda il driver forse è meglio che ti posto tutto il codice così capisci meglio. Questo codice è preso da un tutorial ufficiale sun.
codice:
import java.sql.*;
public class CreateCoffees {
public static void main(String args[]) {
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME VARCHAR(32), " +
"SUP_ID INTEGER, " +
"PRICE FLOAT, " +
"SALES INTEGER, " +
"TOTAL INTEGER)";
Statement stmt;
try {
Class.forName("org.gjt.mm.mysql.Driver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection("jdbc:mysql:3306//87.3.235.149/test?user=mioUser&password=miaPass");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
Ps "test" è il nome del db (che ho già creato).