prov med noget i retningen af nedenstraaende
// navn paa datakilden oprettet via ODBC manageren
String url = "jdbc:odbc:CafeJava";
Connection con;
Statement stmt;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}
try {
con = DriverManager.getConnection(url, "com", "com");
stmt = con.createStatement();
ResultSet resultSet =
stmt.executeQuery("select " +
"name, call, port " +
"from data ");
// Get all rows.
while (resultSet.next()) {
out.println("<p><b>");
out.println(resultSet.getString("name") + " " +
resultSet.getString("call") + " " +
resultSet.getString("port"));
}
resultSet.close();
stmt.close();
con.close();
} catch (SQLException ex) {
System.err.println(ex);
}
check
http://java.sun.com/products/jdbc/index.html for mere information