database-connection

Java & Local Databases

TL DR; Want some Java help with connecting to a truly local database ( no access to server tech ), or if you can whip up code, that will work. All it has to do is query the DB ( MS Access, although can be changed ), and output a JSON string. See EDIT2 for more specificity. EDIT: Before anyone says JDBC; I looked through the tutorials ( ...

Wicket: Where to handle JDBC connection error

Hi, I have a Spring based Wicket app. There's a pooled datasource bean. Now, when MySQL is dead, I get a default Wicket error page with a stacktrace. I'd like to handle this situation and to only allow some pages to fully display (the static ones), and to show a custom error page for the others. How should I efficiently implement thi...

SQL join table with two 'ON' keyword ???

Hi everyone, I have two tables tbl_a and tbl_b and their fields are tbl_a ----- a_id a_name a_surname a_c_id a_d_id tbl_b ----- b_id b_name b_phone b_c_id b_d_id I want to join these two table like this: select *from tbl_a join tbl_b on tbl_a.a_c_id=tbl_b.b_c_id AND tbl_a.a_d_id=tbl_b.b_d_id where tbl_a.id>15; As you can see i w...

What are best practices on managing database connections in .NET?

Regarding best practice for managing database connections in a .NET application -- I know that, in general, it's bad to pass around a connection object. However, I have some specific curiosities: 1. I have two instances of business objects, of different classes, in a parent-child relationship (the child is private.) Whic...

check if mysql connection is valid

I have a long running php script which is basically an infinite loop listening for events (its an xmpp bot), I start the script with nohup php bot.php &. The raw structure of the script is like $mysqli = mysqli_connect(...); while(1) { if(event1) { // do database action } else if(event2) { // non database action ...

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

I am getting following error when i am trying to connect Production DB from Local Environment. I was able to connect Production DB before, but suddenly i am getting following error, any idea? A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, er...

which database type are good for arrays ?

i want my database to support one company haveing many users how can i do that? exampleusers table(UID,username,password)company table(CID,companyname,usersthatistheownerofthecompany) how can i do that? what should i do ? should i make an array in php like 1241,423,4123 *uid's that will be inserted on usersthatistheownerofthecompany row ...

Changing the ConnectionString in Entity Framework 4

I'm working on updating an old system, and we're introducing Entity Framework for some new functionality. The system is, however, too large to do the migration in one step, so I would like to do some testing in another database before updating the db schema. I have created an empty model, included a couple of tables from the database, a...

How to connect "Database" with Turbo C++?

I want to connect "Microsoft Access" with "Turbo C++". How can I do that? ...

explain why an object has lifetime outside scope

Hi, I've written a class as follows. I've written it taking into consideration that its mainly for use on the web (i.e. it will be used from aspx pages). public class TestHelper { public TestHelper() { HttpContext ctxt = HttpContext.Current; IHttpHandler RequestHandler = ctxt.Handler; Page CurrentPag...

Creating a connection pool in a java command line application

Is it possible to create a command line application (without an application server) That uses a connection pool in order to access the database?. And how to do it? I've tried it using an InitialContext object and look up for the datasource in the context but since i don't have an application server i don't know how to access the resou...

What architecture to follow to connect to multiple databases

Dear All, I'm building a core java application in which i have say 20 databases and want to connect to each of them depending upon from where request has come to access which database. I want to connect to databases only once from where i can pick the connection and return; please suggest what type of architecture to follow. ...

Problem connecting to ASP.NET Membership services database

I have been making some changes to an application that uses an ASP.NET Membership services database for authentication. I can access the database locally using windows authentication, and using my SA user. However, after moving the application to the prod. server, I can't access the DB at all. I wrote a simple test-app to test my conn...

ASP shopping cart

Hello based on the example at http://www.15seconds.com/issue/010411.htm i will like to create an ASP shop but i would like to rewrite the connection to db as i don't have a dedicated server . Instead of Sub SubGetDSNCreateConn strBasketDSN = Application("strBaskDSN") set BaskConn = server.CreateObject ("ADODB.Connection") BaskConn.Conn...

programmatically manage db connection while using datasets

I was just thinking if there was a way to programmatically open and close connections to the database via the dataset classes we've added into the project. I am trying to avoid one specific problem. Assume there is an EmployeeTableAdapter. It has two methods IsValid(string EmployeeID) and HasDepartmentAccess(string EmployeeID, string De...

Execute a piece of SQL on JDBC connection setup in Spring

I want to execute an SQL statement on setup of each database connection. I'm using Spring 2.0.2 and org.apache.commons.dbcp.BasicDataSource from Apache Commons DBCP 1.2.1. BasicDataSource seems to have property connectionInitSqls, but only in the newer version... anyone knows a way to set something like that in the older version? This i...

ADO.net Connection Pooling

In the code below, the Provider object only has one instance of a DbConnection. Each reader will reference the same connection instance. According to the Microsoft documentation, the second reader will get a second connection from the connection pool. This works correctly. using (var reader1 as IDataReader = Provider.GetReader(sqlStatem...

sharing a database connection between applications in c#

I was was wondering if anyone knows if it is possible to have multiple applications share the same database connection e.g if I have an application which opens a connection to a database then I start another application which needs to connect to the same database - so instead of having 2 connections open, I use the connection from the f...

iphone programming ? How to connect to Remote Database (like SQL server 2008, MySQL, Oracle, etc.,) from iphone?.

Hello there, One Question "How to connect to Remote Database (like SQL server 2008, MySQL, Oracle, etc.,)?." I know there are ways like, web-services and one more complicated one, using UIWebViews (by Using Scripting languages.. like javascript). leave these...... Tell me is there any connectivity like JDBC, ODBC., etc..... ? I d...

Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact

Hi, I have a .Net service that connects to an Oracle database on every request. It works fine at the beginning, but after some number of requests I start getting: Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection c...