home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 1.2 KB | 46 lines |
- // This snippet creates a new data module
- // that is connected to the Dataset Tutorial database
- // <File=EmployeeData.java>
-
- //Title:
- //Version:
- //Copyright:
- //Author:
- //Company:
- //Description:
- //
-
- //<PACKAGE>
-
- import borland.sql.dataset.*;
-
- public class EmployeeData implements borland.jbcl.dataset.DataModule {
- private static EmployeeData myDM;
- Database database1 = new Database();
- QueryDataSet queryDataSet1 = new QueryDataSet();
-
- public EmployeeData() {
- try {
- jbInit();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void jbInit() throws Exception {
- database1.setConnection(new borland.sql.dataset.ConnectionDescriptor("jdbc:odbc:dataset tutorial", "sysdba", "masterkey", false, "sun.jdbc.odbc.JdbcOdbcDriver;interbase.interclient.Driver"));
- queryDataSet1.setQuery(new borland.sql.dataset.QueryDescriptor(database1, "select * from employee", null, true, false));
- }
-
- static public EmployeeData getDataModule() {
- if (myDM == null)
- myDM = new EmployeeData();
- return myDM;
- }
-
- public borland.sql.dataset.QueryDataSet getQueryDataSet1() {
- return queryDataSet1;
- }
- }
-