sqlite jdbc setJournalMode -


i running first trials on sqlite (with jdbc) pure memory database. need fast inserts tried set config accordingly. find out code below fails @ setting journalmode. please refer method shown below. variables con , isconnected defined class vars , not shown here.

thanks lot

rolf

public boolean connect() {     try {          class.forname("org.sqlite.jdbc");      // sqlitejdbc_3.7.2         // set pragmas          sqliteconfig config = new sqliteconfig();           // statement (journalmode setting) causes fail          // without statement connection can established          // ==> java.sql.batchupdateexception: batch entry 0: query returns results          config.setjournalmode(journalmode.memory);             config.settempstore(tempstore.memory);          config.setsynchronous(synchronousmode.off);          config.enforceforeignkeys(false);          config.enablecountchanges(false);           con = drivermanager.getconnection("jdbc:sqlite::memory:", config.toproperties());            isconnected = true ;          return  true ;     }     catch (exception e) {         logmessages.instance().print(0, logmessages.msg_severity.error, e.getmessage() + "\n");         e.printstacktrace() ;         return false ;     }  } 

i have same issue, there other way disable it. after opening connection can execute query : pragma journal_mode=memory;


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -