database-connection

dbcp having problems returning connections when database is unavailable

I found the following link by erickson dated jan 29, 2009: http://stackoverflow.com/questions/490288/is-dbcp-apache-commons-database-connection-pooling-still-relevant/490358#490358 "DBCP has serious flaws. I don't think it's appropriate for a production application, especially when so many drivers support pooling in their DataSource na...

The underlying provider failed on Open

I was using .mdf for connect to DB and entityClient. Now i want to change connection string that trehe will be no .mdf Is this conectionstring correct <connectionStrings> <!--<add name="conString" connectionString="metadata=res://*/conString.csdl|res://*/conString.ssdl|res://*/conString.msl;provider=System.Data.SqlClient;provider conne...

Connect two database from 2 different host

Hi, currently I have two websites: 1. A website connected to mySQL database in host A. 2. A website connected to Ms. Access database in Host B. Is there anyway if I update the database in Host B, the database in Host A can be updated automatically? Thank you. Really appreciate your help. ...

Objective-C: Database support

How can I connect to an Oracle database and SQL Server 2005-2008 database with Objective-C? ...

How do I execute queries upon DB connection in Rails?

I have certain initializing functions that I use to set up audit logging on the DB server side (ie, not rails) in PostgreSQL. At least one has to be issued (setting the current user) before inserting data into or updating any of the audited tables, or else the whole query will fail spectacularly. I can easily call these every time befor...

Is it OK to re-create many SQL connections (SQL 2008)

When performing many inserts into a database I would usually have code like this: using (var connection = new SqlConnection(connStr)) { connection.Open(); foreach (var item in items) { var cmd = new SqlCommand("INSERT ...") cmd.ExecuteNonQuery(); } } I now want to shard the database and therefore need to choose the c...

Why can’t I create a database in an empty ASP MVC 2 project using Project->Add->New Item->SQL Server Database?

I'm diving head first into ASP MVC and am playing around with creating and manipulating a database. I did a search and found this tutorial for creating a database, however when I follow it, I get this error right at the start when trying to add a new database to my fresh, empty ASP MVC 2 project... A network-related or instance-speci...

SQLCODE -1390 connecting to DB2 64 bit client from 32 bit app

Hi there, I've got a 32 bit application that connects normally to a DB2 database. (written in C) When I run it on a machine with a DB2 64 bit client, I get a SQLCODE -1390 from connect. (Win7 64 Bit, DB2 V9.7 client 64 bit) Connecting from the command line works (db2 connect to ...) With a 32 Bit DB2 client on the same Win7 64 Bit machi...

Subsonic 3.0 Active Record Mysql connection issues with remote server

Hello, Updated below I couldn't describe the question any better without going into detail. I am having major issues with development/deployment of projects using SubSonic. Up until now everything has been fine but this is seriously hampering my progress. The project, while not important, is a CMS/Shopping Cart. I am using Visu...

PHP Database connection practice

I have a script that connects to multiple databases (Oracle, MySQL and MSSQL), each database connection might not be used each time the script runs but all could be used in a single script execution. My question is, "Is it better to connect to all the databases once in the beginning of the script even though all the connections might not...

iPhone SQLite connection in domain object - close each time?

I have what I would consider a small sized iPhone app that uses SQLite. There is a singleton domain object which gets data from a SQLite database. Is it better to create and open the SQLite connection for each request, or to open the DB once and hold on to it for the duration of the app. The app's reason for being is the domain object...

Error in connection in ruby.

require 'rubygems' require 'mysql' db = Mysql.connect('localhost', 'root', '', 'mohit') //db.rb:4: undefined method `connect' for Mysql:Class (NoMethodError) //undefined method `real_connect' for Mysql:Class (NoMethodError) db.query("CREATE TABLE people ( id integer primary key, name varchar(50), age integer)") db.query("INSERT INTO peop...

C# Modify Connection String that exists inside a library

I have a Class Library, which inside just has a DataSet (MySQL connector) and a Connector class. I use this class in multiple projects to connect to the database, and I always had the password embedded in the connection string but now I need to be able to modify this string(for security purposes) so I can have the user connect using the...

How to deal with databases for websites written in Java, more specifically Wicket?

Hi there. I'm new to website development using Java but I've got started with Wicket and make a little website. I'd like to expand on what I've already made (a website with a form, labels and links) and implement database connectivity. I've looked at a couple of examples, in example Mystic Paste, and I see that they're using Hibernate ...

How do I close a database connection being used to produce a streaming result in a WCF service?

I have been unable to find any documentation on properly closing database connections in WCF service operations. I have a service that returns a streamed response through the following method. public virtual Message GetData() { string sqlString = BuildSqlString(); SqlConnection conn = Utils.GetConnection(); SqlCommand cmd =...

VB6. DataEnvironment: How to Configure/Set Trusted Connection?

Hi, I have a DataEnvironment component in my VB 6 application. I cant configure the DataEnvironment connection to use trusted connection without ask me how to connect. I could set prompt to never appear, but it doesnt connect becouse it doesnt use trusted. In this link you could see the screens of DataEnvironment Connection Options and...

close fails on database connections (managed connection cleanup fails) in websphere 7 but not in websphere 6.1

I have a simple method (used in a web application through servlets) that gets a connection from a JNDI name and issues a select statement (get connection, issue select, return result, close the connection etc. in finally). Due to other methods in the application the connection is set as autocommit=false. This method works normally in web...

MVC 2 Catch-All for connection string missing or connect failure

In the event my project is deployed with an incorrect, incomplete or missing connection string i'd like an application startup check for db connectivity, and if there is none, direct all requests to a DatabaseConnectionError page of some sort, what are my options? I don't think there's a specific http error code that would fit this error...

What happens when you close an Entity Framework connection

We are using Entity Framework 1.0. In some cases we need to explicitly open connections, and then need to explicitly close connections. See http://msdn.microsoft.com/en-us/library/bb738582.aspx My question is, when we call "close" does the connection actually get closed, or is it just returned to the connection pool? ...

How can I change the look of SQL Server Managment Studio based on which database I'm connected to?

I'd like to modify the appearance of the query window in SQL Server Management Studio based on which database I'm currently connected to. For example, using a yellow background for production databases. Is there a way to do this? UPDATE: Is there also a way to change the default color of the query status bar at the bottom (when a serv...