我看国下面这个帖子,但不知到要导入什么其它的才能,要不“Connection c = new Connection();”都不成。
实现方法如下:
{
Connection c = new Connection();
c.setConnectionString ("dsn=aDSNName;pwd=aName;pwd=aPWD;database=aDatabase");
c.setCommandTimeout (10);
c.setConnectionTimeout (10);
c.setCursorLocation (AdoEnums.adUseClientBatch);
// Verify that the propertiea on the connection
// were set correctly. If not, return a fail condition.
if (c.getCommandTimeout() != 10)
return false;
if (c.getConnectionTimeout() != 10)
return false;
if (c.getCursorLocation() != AdoEnums.adUseClientBatch)
return false;
if (c.getMode() != AdoEnums.adModeUnknown)
return false;
// Create a new Recordset to contain the results
// of the SQL DML operation (select * ...).
Recordset rs= c.execute ("select * from authors");
rs.moveFirst();
rs.moveLast();
// Delete all rows from the authors table.
c.executeUpdate ("delete from authors");
// Close the Connection and Recordset.
rs.close();
c.close();
return true;
}