Creating the DataStore file store = new DataStore();
l Set the fileName for the DataStore file. store.setFileName(jdbcURL);
l Set any other properties that must be set at create-time, like the blockSize, if desired.
l To make the DataStore transactional:
Instantiate a TxManager new TxManager()
Assign it to the DataStore's txManager: store.setTxManager(new TxManager() )
l Assign a name to the DataStore's userName property store.setUserName(jdbcUser);
l Call the DataStore's create method store.create();
the create method (if successful) results in an open connection to the newly-created DataStore through the DataStore object
Connecting the JdataStore Database
you should use the DataStoreConnection class to open a connection to an existing DataStore.
storeConnect = new DataStoreConnection();
storeConnect.setFileName(jdbcURL);
storeConnect.setUserName(jdbcUser);
When using the DataStore with a StorageDataSet:
l DataSet.setStoreName("TabelleName");
l DataSet.setStore(storeConnect);
Database and DataSet are implicitly opened when visual components bound to them open. When you are not using a visual component, you must explicitly open a DataSet. opening a DataSet implicitly opens a Database. A Database is never implicitly closed.
To make any data set updateable, set the updateMetaData property to NONE
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/61367/viewspace-797667/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/61367/viewspace-797667/