try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:odbc:; Driver={Microsoft Access Driver (*.mdb)}; dbq=BookStore.mdb");
Statement command = conn.createStatement();
ResultSet rs = command.executeQuery("Select * FROM Customers");
while (rs.next())
{
[b]jTextField1.getText(rs.getString("Name"));[/b]
}
command.close();
conn.close();
}
catch (Exception e)
{
System.out.println(e.toString());
}
Note the code in bold, How do I code the data from the db to this program, because the above is not entirely correct?

New Topic/Question
Reply




MultiQuote




|