public JCursor(JConnect connect) { this.connect = connect; this.handler = connect.handler; connection = connect.Connection; this.queryToLong = connect.queryToLong; }
/// <summary> /// Set up Portal connection /// </summary> /// <param name="connection">Db Connection</param> /// <param name="handler">Handel logging and credentials</param> /// <param name="queryToLong">Will log long running queries as warning</param> public JConnect(IDbConnection connection, PortalHandlerBase handler = null, int queryToLong = 5) { this.connection = connection; this.handler = handler; this.queryToLong = queryToLong; commandTimeout = 300; Type type = connection.GetType(); if (type == typeof(System.Data.Odbc.OdbcConnection)) { TypeOfVendor = VendorType.Odbc; } else if (type == typeof(System.Data.OleDb.OleDbConnection)) { TypeOfVendor = VendorType.OleDb; } else if (type == typeof(System.Data.SqlClient.SqlConnection)) { TypeOfVendor = VendorType.SqlServer; } else if (type == typeof(System.Data.SQLite.SQLiteConnection)) { TypeOfVendor = VendorType.Lite3; } else { TypeOfVendor = VendorType.Oracle; } GetTimeStampProc = DefaultGetTimeStampProc; GetUserStampProc = DefaultGetUserStampProc; }