Пример #1
0
            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);
            }
Пример #2
0
            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;
            }
Пример #3
0
            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;
                }
            }
Пример #4
0
            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);
            }
Пример #5
0
            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;
                }
            }
Пример #6
0
 public static void Commit(RhoDatabase/*!*/ self)
 {
     try
     {
         self.m_db.commit();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "commit");
     }
 }
Пример #7
0
 public static void startTransaction(RhoDatabase /*!*/ self)
 {
     try
     {
         self.m_db.startTransaction();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "start_transaction");
     }
 }
Пример #8
0
            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

            }
Пример #9
0
 public static void Commit(RhoDatabase /*!*/ self)
 {
     try
     {
         self.m_db.commit();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "commit");
     }
 }
Пример #10
0
 public static void Unlock(RhoDatabase /*!*/ self)
 {
     try
     {
         self.m_db.Unlock();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "unlock_db");
     }
 }
Пример #11
0
            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");
                }
            }
Пример #12
0
            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");
                }
            }
Пример #13
0
            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);
            }
Пример #14
0
            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);
            }
Пример #15
0
 public static void Unlock(RhoDatabase/*!*/ self)
 {
     self.m_db.Unlock();
 }
Пример #16
0
 public static Boolean isUiWaitForDb(RhoDatabase/*!*/ self)
 {
     return self.m_db.isUIWaitDB();
 }
Пример #17
0
 public static void startTransaction(RhoDatabase/*!*/ self)
 {
     self.m_db.startTransaction();
 }
Пример #18
0
 public static Boolean isUiWaitForDb(RhoDatabase /*!*/ self)
 {
     return(true);
 }
Пример #19
0
 public static void Rollback(RhoDatabase /*!*/ self)
 {
 }
Пример #20
0
 public static Boolean isTableExist(RhoDatabase /*!*/ self, MutableString /*!*/ tblName)
 {
     return(self.m_db.isTableExist(tblName.ToString()));
 }
Пример #21
0
 public static void destroyTables(RhoDatabase /*!*/ self, RubyArray arInclude, RubyArray arExclude)
 {
 }
Пример #22
0
 public static void Unlock(RhoDatabase/*!*/ self)
 {
     try
     {
         self.m_db.Unlock();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "unlock_db");
     }
 }
Пример #23
0
 public static Boolean isTableExist(RhoDatabase/*!*/ self, MutableString/*!*/ tblName)
 {
     return true;
 }
Пример #24
0
 public static void Commit(RhoDatabase /*!*/ self)
 {
     self.m_db.commit();
 }
Пример #25
0
 public static Boolean isUiWaitForDb(RhoDatabase /*!*/ self)
 {
     return(self.m_db.isUIWaitDB());
 }
Пример #26
0
 public static void Close(RhoDatabase /*!*/ self)
 {
     self.m_db.close();
 }
Пример #27
0
 public static void Rollback(RhoDatabase /*!*/ self)
 {
     self.m_db.rollback();
 }
Пример #28
0
 public static void Unlock(RhoDatabase /*!*/ self)
 {
     self.m_db.Unlock();
 }
Пример #29
0
 public static void Close(RhoDatabase/*!*/ self)
 {
     self.m_db.close();
 }
Пример #30
0
 public static void Close(RhoDatabase/*!*/ self)
 {
 }
Пример #31
0
            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;
            }
Пример #32
0
 public static void Commit(RhoDatabase/*!*/ self)
 {
 }
Пример #33
0
 public static void Commit(RhoDatabase /*!*/ self)
 {
 }
Пример #34
0
            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;
            }
Пример #35
0
            public static RubyArray Execute(RhoDatabase /*!*/ self, MutableString /*!*/ sqlStatement, Boolean isBatch, RubyArray args)
            {
                RubyArray ret = new RubyArray();

                return(ret);
            }
Пример #36
0
 public static RubyArray Execute(RhoDatabase/*!*/ self, MutableString/*!*/ sqlStatement, Boolean isBatch, RubyArray args)
 {
     RubyArray ret = new RubyArray();
     return ret;
 }
Пример #37
0
 public static void Lock(RhoDatabase /*!*/ self)
 {
 }
Пример #38
0
 public static Boolean isUiWaitForDb(RhoDatabase/*!*/ self)
 {
     return true;
 }
Пример #39
0
 public static void startTransaction(RhoDatabase /*!*/ self)
 {
 }
Пример #40
0
 public static void Lock(RhoDatabase/*!*/ self)
 {
 }
Пример #41
0
 public static void Rollback(RhoDatabase/*!*/ self)
 {
     self.m_db.rollback();
 }
Пример #42
0
            public static void Rollback(RhoDatabase/*!*/ self)
            {
 
            }
Пример #43
0
 public static Boolean isTableExist(RhoDatabase/*!*/ self, MutableString/*!*/ tblName)
 {
     return self.m_db.isTableExist( tblName.ToString() );
 }
Пример #44
0
 public static void startTransaction(RhoDatabase/*!*/ self)
 {
 }
Пример #45
0
 public static void startTransaction(RhoDatabase/*!*/ self)
 {
     try
     {
         self.m_db.startTransaction();
     }
     catch (Exception ex)
     {
         LOG.HandleRubyException(ex, RhoRuby.rubyContext.CurrentException, "start_transaction");
     }
 }
Пример #46
0
 public static Boolean isTableExist(RhoDatabase /*!*/ self, MutableString /*!*/ tblName)
 {
     return(true);
 }
Пример #47
0
            public static void Commit(RhoDatabase/*!*/ self)
            {
                self.m_db.commit();

            }
Пример #48
0
 public static void Close(RhoDatabase /*!*/ self)
 {
 }
Пример #49
0
 public static void destroyTables(RhoDatabase/*!*/ self, RubyArray arInclude, RubyArray arExclude)
 {
 }
Пример #50
0
 public static void startTransaction(RhoDatabase /*!*/ self)
 {
     self.m_db.startTransaction();
 }