public JDBCCategoryDataset(String url,String driverName,String user,String passwd) throws ClassNotFoundException, SQLException {
  Class.forName(driverName);
  this.connection=DriverManager.getConnection(url,user,passwd);
}

public JDBCCategoryDataset ( String url , String driverName , String user , String passwd ) throws ClassNotFoundException , SQLException { Class . forName ( driverName ) ; this . connection = DriverManager . getConnection ( url , user , passwd ) ; }
creates a new dataset with a database connection .
