database-connection

to close connection to database after i use or not?

可紊 提交于 2020-01-05 06:29:08
问题 is it be better to open connection to database - make any querys...update....delete - and after i use to close this connection or open the connection when the program load - and close when the program close ? thanks in advance 回答1: In general, you Close (Dispose) as soon as possible in your code. With a try/finally or using block. What actually happens depends on the ConnectionPool settings for your app. Basically the presence of the ConnectionPool means you don't have to worry about the

to close connection to database after i use or not?

拈花ヽ惹草 提交于 2020-01-05 06:29:07
问题 is it be better to open connection to database - make any querys...update....delete - and after i use to close this connection or open the connection when the program load - and close when the program close ? thanks in advance 回答1: In general, you Close (Dispose) as soon as possible in your code. With a try/finally or using block. What actually happens depends on the ConnectionPool settings for your app. Basically the presence of the ConnectionPool means you don't have to worry about the

C# Connect to Oracle DataBase Error ORA-12545: Connect failed because target host or object does not exist

*爱你&永不变心* 提交于 2020-01-05 06:28:53
问题 I want to connect to Oracle database from C# but I can't Because this errors that ORA-12545: Connect failed because target host or object does not exist so how can i ? C# code string strConn = "Data Source =(DESCRIPTION =" + "(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-EIQ5MRF)(PORT = 1521))" + "(CONNECT_DATA =" + " (SERVER = DEDICATED)" + "(SERVICE_NAME = XE)" + ")" + ");User Id =system;password=bluesky;"; OracleConnection conn = new OracleConnection(strConn); conn.Open(); conn.Close();

Write Multiple queries in database connector in Mule

末鹿安然 提交于 2020-01-05 05:10:13
问题 I want to write select and insert queries for 3 tables for the same database using a database connector. I want to know is there a alternative or how can it be done using 1 database connector? I ended up using 5 database connector. But I think this makes the flow look complicated. Is there any other way of doing this. 回答1: You are going in a wrong way :) It can be achieved by a single DB connector performing 3 different operations. Pls go through the documentation here :- https://docs

Python - Can't connect to MS SQL

[亡魂溺海] 提交于 2020-01-05 04:51:49
问题 When I try to connect to MS SQL, I got this error: > pyodbc.Error: ('08001', '[08001] [Microsoft][ODBC Driver 13 for SQL > Server]SQL Server Network Interfaces: Error Locating Server/Instance > Specified [xFFFFFFFF]. (-1) (SQLDriverConnect); [HYT00] > [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired (0); > [08001] [Microsoft][ODBC Driver 13 for SQL Server]A network-related or > instance-specific error has occurred while establishing a connection > to SQL Server. Server is not

Importing CSV to Django and settings not recognised

大城市里の小女人 提交于 2020-01-05 04:16:51
问题 So i'm getting to grips with Django, or trying to. I have some code that isn't dependent on being called by the webpage - it's designed to populate the database with information. Eventually it will be set up as a cron job to run overnight. This is the first crack at it, which is to do an initial population (once I have that working, I'll move to an add structure, where only new records are pushed.) I'm using Python 2.7, Django 1.5 and Sqlite3. When I run this code, I get Requested setting

Django: Exception Value (2013, '2013: Lost connection to MySQL server during query', None)

安稳与你 提交于 2020-01-04 13:31:51
问题 Recently I have upgraded Django from version 1.6.5 to 1.7.1 and mysql-connector-python from 1.x to 2.0.2 After upgrading, the Exception(2013) is raised most of the time I make a query. Exception Type: InterfaceError Exception Value: (2013, '2013: Lost connection to MySQL server during query', None) I have added some settings about 'CONN_MAX_AGE', 'wait_timeout' but it does not help. Here are my settings: From command line: C:/>pip freeze Django==1.7.1 South==1.0.1 mysql-connector-python==2.0

Django: Exception Value (2013, '2013: Lost connection to MySQL server during query', None)

有些话、适合烂在心里 提交于 2020-01-04 13:30:10
问题 Recently I have upgraded Django from version 1.6.5 to 1.7.1 and mysql-connector-python from 1.x to 2.0.2 After upgrading, the Exception(2013) is raised most of the time I make a query. Exception Type: InterfaceError Exception Value: (2013, '2013: Lost connection to MySQL server during query', None) I have added some settings about 'CONN_MAX_AGE', 'wait_timeout' but it does not help. Here are my settings: From command line: C:/>pip freeze Django==1.7.1 South==1.0.1 mysql-connector-python==2.0

SingleConnectionDataSource connection closed after about 40 minutes inactivity

强颜欢笑 提交于 2020-01-04 08:17:43
问题 We have a problem with org.springframework.jdbc.datasource.SingleConnectionDataSource ? We expect that the connection is never closed while the application is running, even if there is no traffic between application and db. We configured datasource with <property name="suppressClose" value="true"/> what should solve the problem. And the problem is that the connection is closed after about 30-40 minutes of inactivity (when there is no traffic between db and application). Maybe someone with

SingleConnectionDataSource connection closed after about 40 minutes inactivity

拥有回忆 提交于 2020-01-04 08:16:11
问题 We have a problem with org.springframework.jdbc.datasource.SingleConnectionDataSource ? We expect that the connection is never closed while the application is running, even if there is no traffic between application and db. We configured datasource with <property name="suppressClose" value="true"/> what should solve the problem. And the problem is that the connection is closed after about 30-40 minutes of inactivity (when there is no traffic between db and application). Maybe someone with