Posted Thursday, September 15, 2005 @ 00:28:03
hello. i hv an error when i connect to the database. this is my code.
this.add(dbTable1);
dbTable1.setDatabaseDriver("sun.jdbc.odbc.JdbcOdbcDriver");
dbTable1.setJdbcUrl("jdbc:odbc:dbRegiSystem");
dbTable1.setSelectSql("SELECT id, name, pass, stat FROM tbluser");
dbTable1.createControlPanel();
dbTable1.addUpdateSql("UPDATE tbluser SET name = ?, pass = ?, stat = ? WHERE id = ?", "2 , 3, 4, 1");
dbTable1.addInsertSql("INSERT INTO tbluser (id, name, pass, stat) VALUES (?,?,?,?)", "1,2,3,4");
dbTable1.addDeleteSql("DELETE tbluser WHERE id = ?", "1");
try
{
dbTable1.connectDatabase();
dbTable1.refresh();
}
catch (SQLException ex)
{
System.out.println(ex.getMessage());
ex.printStackTrace();
}
dbTable1.setEditable(true);
dbTable1.enableExcelCopyPaste();
The code is not working. can anyone help me to solve this.
thanks in advance.... :)
--------------------