JDBC ODBC connection can be used to connect to a database and perform different operstions. Following code sample connects to a database, performs a query and displays contents of a column.
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection(url, name, pass);
Statement s = c.createStatement();
ResultSet rs = s.executeQuery ( query );
while (rs.next()) {
System.out.println (rs.getString("colName"));
}