public static void destroyTables(RhoDatabase /*!*/ self, RubyArray arInclude, RubyArray arExclude) { Vector <String> vecIncludes = RhoRuby.makeVectorStringFromArray(arInclude); Vector <String> vecExcludes = RhoRuby.makeVectorStringFromArray(arExclude); self.m_db.rb_destroy_tables(vecIncludes, vecExcludes); }
public static RhoDatabase/*!*/ Create(RubyClass/*!*/ self, [NotNull]MutableString/*!*/ dbName, [NotNull]MutableString/*!*/ dbPartition) { RhoDatabase rbDB = new RhoDatabase(); rbDB.m_db = new DBAdapter(); rbDB.m_db.rb_open(dbName.ToString(), dbPartition.ToString()); return rbDB; }
public static RubyArray Execute(RhoDatabase/*!*/ self, MutableString/*!*/ sqlStatement, Boolean isBatch, RubyArray args) { try { RubyArray retArr = new RubyArray(); if (isBatch) { self.m_db.executeBatchSQL(sqlStatement.ToString()); } else { Object[] values = null; if (args != null && args.Count > 0) { if (args[0] != null && args[0] is RubyArray) values = ((RubyArray)args[0]).ToArray(); else values = args.ToArray(); } try { self.m_db.Lock(); using (IDBResult rows = self.m_db.executeSQL(sqlStatement.ToString(), values, true)) { if (rows != null) { MutableString[] colNames = null; for (; !rows.isEnd(); rows.next()) { IDictionary<object, object> map = new Dictionary<object, object>(); Hash row = new Hash(map); for (int nCol = 0; nCol < rows.getColCount(); nCol++) { if (colNames == null) colNames = getOrigColNames(rows); row.Add(colNames[nCol], rows.getRubyValueByIdx(nCol)); } retArr.Add(row); } } } } finally { self.m_db.Unlock(); } } return retArr; }catch (Exception exc) { //TODO: throw ruby exception throw exc; } }
public static RhoDatabase /*!*/ Create(RubyClass /*!*/ self, [NotNull] MutableString /*!*/ dbName, [NotNull] MutableString /*!*/ dbPartition) { RhoDatabase rbDB = new RhoDatabase(); rbDB.m_db = new DBAdapter(); rbDB.m_db.rb_open(dbName.ToString(), dbPartition.ToString()); return(rbDB); }
public static RubyArray Execute(RhoDatabase /*!*/ self, MutableString /*!*/ sqlStatement, Boolean isBatch, RubyArray args) { try { RubyArray retArr = new RubyArray(); if (isBatch) { self.m_db.executeBatchSQL(sqlStatement.ToString()); } else { Object[] values = null; if (args != null && args.Count > 0) { if (args[0] != null && args[0] is RubyArray) { values = ((RubyArray)args[0]).ToArray(); } else { values = args.ToArray(); } } using (IDBResult rows = self.m_db.executeSQL(sqlStatement.ToString(), values, true)) { if (rows != null) { MutableString[] colNames = null; for (; !rows.isEnd(); rows.next()) { IDictionary <object, object> map = new Dictionary <object, object>(); Hash row = new Hash(map); for (int nCol = 0; nCol < rows.getColCount(); nCol++) { if (colNames == null) { colNames = getOrigColNames(rows); } row.Add(colNames[nCol], rows.getRubyValueByIdx(nCol)); } retArr.Add(row); } } } } return(retArr); }catch (Exception exc) { //TODO: throw ruby exception throw exc; } }
public static void Commit(RhoDatabase/*!*/ self) { try { self.m_db.commit(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "commit"); } }
public static void startTransaction(RhoDatabase /*!*/ self) { try { self.m_db.startTransaction(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "start_transaction"); } }
public static void destroyTables(RhoDatabase/*!*/ self, RubyArray arInclude, RubyArray arExclude) { Vector<String> vecIncludes = RhoRuby.makeVectorStringFromArray(arInclude); Vector<String> vecExcludes = RhoRuby.makeVectorStringFromArray(arExclude); self.m_db.rb_destroy_tables(vecIncludes, vecExcludes); //throw (e instanceof RubyException ? (RubyException)e : new RubyException(e.getMessage())); //TODO: threw ruby exception }
public static void Commit(RhoDatabase /*!*/ self) { try { self.m_db.commit(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "commit"); } }
public static void Unlock(RhoDatabase /*!*/ self) { try { self.m_db.Unlock(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "unlock_db"); } }
public static void destroyTables(RhoDatabase/*!*/ self, RubyArray arInclude, RubyArray arExclude) { try { Vector<String> vecIncludes = RhoRuby.makeVectorStringFromArray(arInclude); Vector<String> vecExcludes = RhoRuby.makeVectorStringFromArray(arExclude); self.m_db.rb_destroy_tables(vecIncludes, vecExcludes); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "destroy_tables"); } }
public static void destroyTables(RhoDatabase /*!*/ self, RubyArray arInclude, RubyArray arExclude) { try { Vector <String> vecIncludes = RhoRuby.makeVectorStringFromArray(arInclude); Vector <String> vecExcludes = RhoRuby.makeVectorStringFromArray(arExclude); self.m_db.rb_destroy_tables(vecIncludes, vecExcludes); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "destroy_tables"); } }
public static Boolean isTableExist(RhoDatabase /*!*/ self, MutableString /*!*/ tblName) { Boolean res = false; try { res = self.m_db.isTableExist(tblName.ToString()); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "table_exist?"); } return(res); }
public static Boolean isUiWaitForDb(RhoDatabase /*!*/ self) { Boolean res = false; try { res = self.m_db.isUIWaitDB(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "is_ui_waitfordb"); } return(res); }
public static void Unlock(RhoDatabase/*!*/ self) { self.m_db.Unlock(); }
public static Boolean isUiWaitForDb(RhoDatabase/*!*/ self) { return self.m_db.isUIWaitDB(); }
public static void startTransaction(RhoDatabase/*!*/ self) { self.m_db.startTransaction(); }
public static Boolean isUiWaitForDb(RhoDatabase /*!*/ self) { return(true); }
public static void Rollback(RhoDatabase /*!*/ self) { }
public static Boolean isTableExist(RhoDatabase /*!*/ self, MutableString /*!*/ tblName) { return(self.m_db.isTableExist(tblName.ToString())); }
public static void destroyTables(RhoDatabase /*!*/ self, RubyArray arInclude, RubyArray arExclude) { }
public static void Unlock(RhoDatabase/*!*/ self) { try { self.m_db.Unlock(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "unlock_db"); } }
public static Boolean isTableExist(RhoDatabase/*!*/ self, MutableString/*!*/ tblName) { return true; }
public static void Commit(RhoDatabase /*!*/ self) { self.m_db.commit(); }
public static Boolean isUiWaitForDb(RhoDatabase /*!*/ self) { return(self.m_db.isUIWaitDB()); }
public static void Close(RhoDatabase /*!*/ self) { self.m_db.close(); }
public static void Rollback(RhoDatabase /*!*/ self) { self.m_db.rollback(); }
public static void Unlock(RhoDatabase /*!*/ self) { self.m_db.Unlock(); }
public static void Close(RhoDatabase/*!*/ self) { self.m_db.close(); }
public static void Close(RhoDatabase/*!*/ self) { }
public static Boolean isUiWaitForDb(RhoDatabase/*!*/ self) { Boolean res = false; try { res = self.m_db.isUIWaitDB(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "is_ui_waitfordb"); } return res; }
public static void Commit(RhoDatabase/*!*/ self) { }
public static void Commit(RhoDatabase /*!*/ self) { }
public static Boolean isTableExist(RhoDatabase/*!*/ self, MutableString/*!*/ tblName) { Boolean res = false; try { res = self.m_db.isTableExist(tblName.ToString()); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "table_exist?"); } return res; }
public static RubyArray Execute(RhoDatabase /*!*/ self, MutableString /*!*/ sqlStatement, Boolean isBatch, RubyArray args) { RubyArray ret = new RubyArray(); return(ret); }
public static RubyArray Execute(RhoDatabase/*!*/ self, MutableString/*!*/ sqlStatement, Boolean isBatch, RubyArray args) { RubyArray ret = new RubyArray(); return ret; }
public static void Lock(RhoDatabase /*!*/ self) { }
public static Boolean isUiWaitForDb(RhoDatabase/*!*/ self) { return true; }
public static void startTransaction(RhoDatabase /*!*/ self) { }
public static void Lock(RhoDatabase/*!*/ self) { }
public static void Rollback(RhoDatabase/*!*/ self) { self.m_db.rollback(); }
public static void Rollback(RhoDatabase/*!*/ self) { }
public static Boolean isTableExist(RhoDatabase/*!*/ self, MutableString/*!*/ tblName) { return self.m_db.isTableExist( tblName.ToString() ); }
public static void startTransaction(RhoDatabase/*!*/ self) { }
public static void startTransaction(RhoDatabase/*!*/ self) { try { self.m_db.startTransaction(); } catch (Exception ex) { LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "start_transaction"); } }
public static Boolean isTableExist(RhoDatabase /*!*/ self, MutableString /*!*/ tblName) { return(true); }
public static void Commit(RhoDatabase/*!*/ self) { self.m_db.commit(); }
public static void Close(RhoDatabase /*!*/ self) { }
public static void destroyTables(RhoDatabase/*!*/ self, RubyArray arInclude, RubyArray arExclude) { }
public static void startTransaction(RhoDatabase /*!*/ self) { self.m_db.startTransaction(); }