コード例 #1
0
ファイル: SQLRelayCommand.cs プロジェクト: joegana/sqlrelay
        private SQLRCursor getCursor()
        {
            if (_sqlrcur == null)
            {
                _sqlrcur = new SQLRCursor(_sqlrelaycon.SQLRConnection);

                if (_sqlrelaycon._columnnamecase == "upper")
                {
                    _sqlrcur.upperCaseColumnNames();
                }
                else if (_sqlrelaycon._columnnamecase == "lower")
                {
                    _sqlrcur.lowerCaseColumnNames();
                }

                _sqlrcur.setResultSetBufferSize(_sqlrelaycon._resultsetbuffersize);

                if (_sqlrelaycon._dontgetcolumninfo)
                {
                    _sqlrcur.dontGetColumnInfo();
                }

                if (_sqlrelaycon._nullsasnulls)
                {
                    _sqlrcur.getNullsAsNulls();
                }
            }
            return(_sqlrcur);
        }
コード例 #2
0
        public static void Main()
        {
            SQLRConnection con = new SQLRConnection("sqlrserver", 9000, "/tmp/example.socket", "user", "password", 0, 1);
            SQLRCursor     cur = new SQLRCursor(con);

            // column names will be forced to upper case
            cur.upperCaseColumnNames();
            cur.sendQuery("select * from my_table");
            con.endSession();

            for (UInt32 i = 0; i< cur.colCount(); i++)
            {
                Console.Write("Name:          ");
                Console.WriteLine(getColumnName(i));
                Console.Write("\n");
            }

            // column names will be forced to lower case
            cur.lowerCaseColumnNames();
            cur.sendQuery("select * from my_table");
            con.endSession();

            for (UInt32 i = 0; i< cur.colCount(); i++)
            {
                Console.Write("Name:          ");
                Console.WriteLine(cur.getColumnName(i));
                Console.Write("\n");
            }

            // column names will be the same as they are in the database
            cur.mixedCaseColumnNames();
            cur.sendQuery("select * from my_table");
            con.endSession();

            for (UInt32 i = 0; i< cur.colCount(); i++)
            {
                Console.Write("Name:          ");
                Console.WriteLine(cur.getColumnName(i));
                Console.Write("\n");
            }
        }