import java.sql.*;
public class Lookup
{
public static void main(String[] args)
{
String dbURL = "jdbc:odbc:people";
String user = "";
String password = "";
try
{
// load the driver - it will register itself
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection(dbUrl, user, password);
Statement s = c.createStatement();
String q = "SELECT FIRST, LAST, EMAIL FROM " +
"people.csv people Where (LAST='" + args[0] + "')"
"ORDER BY FIRST";
ResultSet r = s.executeQuery(q);
while (r.next())
{
System.out.print(r.getString("last"));
System.out.print(r.getString("first"));
System.out.println(r.getString("email"));
}
s.close();
} catch (Exception e) {}
}
}