public class Lookup
{
public static void main(String[] args) throws SQLException, ClassNotFoundException {
try {
String dbUrl = “jdbc:odbc:people”;
String user = “”;
String password = “”;
Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);
Connection c = DriverManager.getConnection(dbUrl, “in”, “in”);
Statement s = c.createStatement();
ResultSet r = s.executeQuery("SELECT FIRST, LAST, EMAIL " + "FROM PEOPLE " + "WHERE " + “(LAST=’” + “cardoso” + "’) " + " AND (EMAIL Is Not Null) " + “ORDER BY FIRST”);
while(r.next()) {
System.out.println(r.getString(“Last”) + ", "+ r.getString(“fIRST”)+ ": " + r.getString(“EMAIL”) );
}
s.close();
} catch(SQLException e) {
System.err.println(e);
} catch(ClassNotFoundException e) {
System.err.println(e);
}}}
Ok, este código compila sem erros e a base de dados em mySQL já está criada agora o meu problema é: Como crio o driver no painel de control para ele poder ligar-se à base de dados?
Estou a usar o windows98