예제 #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();
 }