🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jdatastore
1 messages
1 total messages Started by Mehmet F. Erten Thu, 06 Apr 2006 22:39
Here is the code to pack a JDataStore file programmatically.
#46
Author: Mehmet F. Erten
Date: Thu, 06 Apr 2006 22:39
52 lines
2528 bytes
(the following embedded into my code)

import com.borland.datastore.*;

DataStore store1;
DataStore store2;

try
     {
       store1 = new DataStore();
       store1.setUserName("admin_user");
       store1.setPassword("admin_password");
       store1.setFileName("c:\\jdsfilename.jds");
       store1.open();
       store2 = new DataStore();
       store2.setFileName("c:\\copy_jdsfilename.jds");
       store2.setBlockSize(store1.getBlockSize());
       store2.setTxIsolation(store1.getTxIsolation());
       if ( !new java.io.File( store2.getFileName() ).exists() )
       {
         store2.create();
       }
       else
       {
         store2.open();
       }
       store1.copyUsers(store2, "admin_password", false, false);
       store1.copyStreams( "",     // From root directory
                           "*",    // Every stream
                           store2,
                           "",     // To root directory
                           DataStore.COPY_IGNORE_ERRORS,
                           System.out );
     }
     catch ( com.borland.dx.dataset.DataSetException dse )
     {
       dse.printStackTrace();
     }
     finally
     {
         try
         {
           TxManager myTxManager = store1.getTxManager();
           store1.close();
           store2.setTxManager(myTxManager);
           store2.close();
         }
         catch ( com.borland.dx.dataset.DataSetException dse )
         {
           dse.printStackTrace();
         }
     } 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads