Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="oracle"></param>
 public SqlBuilder(OracleServer oracle)
 {
     this.oracle = oracle;
     InitializeComponent();
     populateFunctionList();
     this.Text = "SQL Builder";
 }
Example #2
0
        static void Main(string[] args)
        {
            try
            {
                Logger.EnableLogger();
                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                //Application.
                //MessageBox.Show("Test");
                FileUtility.CleanTempPath();

                //MessageBox.Show("temp path is ready");
                Arguments = args;

                OracleServer oracle = OracleServer.ConnectToOracle();
                //MessageBox.Show("connected attempted oracle");

                if (oracle == null)
                {
                    return;
                }
                Hdb.Instance = new Hdb(oracle);

                Application.Run(new FormMain());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n" + ex.StackTrace);
            }
        }
Example #3
0
 public SqlView(OracleServer oracle)
 {
     this.oracle = oracle;
     InitializeComponent();
     this.Text        = "SQL Viewer";
     this.SqlCommands = oracle.SqlHistory;
 }
Example #4
0
        public static void Main()
        {
            OracleServer oracle = new OracleServer("", "", "uchdbdev.uc.usbr.gov", "", "MST", "1521");

            Hdb.Instance.Server = oracle;

            ModifyValue();
            DeleteValue();
            // InsertValue();
        }
Example #5
0
        public static OracleServer ConnectToOracle(string hostname = "")
        {
            Logger.WriteLine("Connect to '" + hostname + "'");
            DialogResult dr;
            bool         loginSucess = false;
            OracleLogin  login       = new OracleLogin(hostname);
            OracleServer rval        = null;

            do
            {
                dr = login.ShowDialog();
                if (dr == DialogResult.Cancel)
                {
                    return(null);
                }


                rval = new OracleServer(login.ConnectionInfo);
                try
                {
                    loginSucess = rval.ConnectionWorking();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message + "\n" + ex.StackTrace + "\n" + ex.Source);
                    if (ex.InnerException != null)
                    {
                        MessageBox.Show(ex.InnerException.Message);
                    }
                }
            } while (!loginSucess);

            if (rval.LoginCanceled)
            {
                return(null);
            }
            return(rval);
        }
Example #6
0
        /// <summary>
        /// Gets a instance to a hdb,  used by Pisces to support multiple databases
        /// </summary>
        /// <param name="hostname"></param>
        /// <returns></returns>
        public static Hdb GetInstance(string hostname)
        {
            if (Instance != null && Instance.Server.Host == hostname)
            {
                return(Instance);
            }
            else if (s_dict.ContainsKey(hostname))
            {
                return(s_dict[hostname]);
            }
            else
            {
                // To  do..  set hostname for Login user-interface
                var svr = OracleServer.ConnectToOracle(hostname);
                if (svr == null)
                {
                    return(null);
                }

                Hdb hdb1 = new Hdb(svr);
                s_dict.Add(hostname, hdb1);
                return(hdb1);
            }
        }
Example #7
0
 public Hdb(OracleServer server)
 {
     m_server = server;
     LookupApplication();
 }