database-connection

Why is it bad practice to make multiple database connections in one request?

A discussion about Singletons in PHP has me thinking about this issue more and more. Most people instruct that you shouldn't make a bunch of DB connections in one request, and I'm just curious as to what your reasoning is. My first thought is the expense to your script of making that many requests to the DB, but then I counter myself wit...

How do I avoid having the database password stored in plaintext in sourcecode?

In the web-application I'm developing I currently use a naive solution when connecting to the database: Connection c = DriverManager.getConnection("url", "username", "password"); This is pretty unsafe. If an attacker gains access to the sourcecode he also gains access to the database itself. How can my web-application connect to the d...

Persistent DB Connections - Yea or Nay?

I'm using PHP's PDO layer for data access in a project, and I've been reading up on it and seeing that it has good innate support for persistant DB connections. I'm wondering when/if I should use them. Would I see performance benefits in a CRUD-heavy app? Are there downsides to consider, perhaps related to security? If it matters to you...

How to connect to PostgreSQL from .NET using TLS with both client and server authentication?

I want to connect a C# .NET application to a PostgreSQL database, using TLS with client and server authentication: in other words, if the certificate from the client can not be verified against the certificate of the server, the client should get access denied, and if the client can not verify the certificate of the server, the client sh...

Using Actionscript 3 to connect to a database

I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove prohibitive. I have read about using an intermediary step (PH...

SQL Server 2005 has problems connecting to a website running on the same server.

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Hello I am new on developin...

In Classic asp, can I store a database connection in the Session object?

Can I store a database connection in the Session object? ...

Impersonating a User in Asp.Net

My DBA requires all database access to be done through trusted domain account. This can be done if you set the web.config . This requires the user to login or to be on the domain for IE pass the credentials through. I want to impersonate a user by using code. I am using the code found in this knowledgebase article: http://support.m...

Connecting to Informix database from .Net

What's the best way to connect to a Informix database from .Net? I'm developing a client-server application based on a legacy Informix DB which used to be connected by JDBC. I need it, from the most important to the least: To be fast DB server changes not needed No ODBC and no dependencies, other than de .Net Framework 2.0 Thanks i...

ASP.NET trusted DB connection to other server works in Casini, not in IIS

Our website connects to a database correctly when running the website locally using the built-in web server. But, when we deploy the site to our server running IIS, we get a database connection error. The database server is different from our IIS server. Note that a trusted connection to a different database on the SAME server as IIS ...

Best Portable way to connect to SQL server using c++

Hi everyone, I need some help into this problem: Basically i want to connect my program which uses c/c++ to a SQL server database (MS SQL server express or standard edition) , because of our users demands the program needs to be ported to Mac Os too so this connection need to be portable. Any idea of a portable API i can use to do t...

Thoughts on TUDBC

Has anyone used TUDBC? This looks interesting, but I wonder how valuable it would be for me to investigate. I'm curious about anyone's good or bad experience. ...

Does Java Connection.close rollback?

Does Java Connection.close rollback into a finally block?. I know .Net SqlConnection.close does it. With this I could make try/finally blocks without catch... Example: try { conn.setAutoCommit(false); ResultSet rs = executeQuery(conn, ...); .... executeNonQuery(conn, ...); .... conn.commit(); } finally { c...

How do the ExceptionSorter classes in JBoss work?

I am wondering how the JBoss ExceptionSorter classes are able to check for database errors. The application (the EJB or persistence framework) is holding the reference to the database Connection, so SQLExceptions are caught by the application. How is JBoss able to see the contents of the exception? Does JBoss wrap the connection and in...

Abstracting data connection layers and presentation layers in an enterprise application

We are building an enterprise application in which we will incorporate multiple platforms for user interfaces (i.e. ASP.net webapp, Windows Application, and someday, Mobile Apps) and multiple platforms for back-end databases (i.e. SQL Server, XML, Oracle). An additional neccesity is that these back-end DBs either be centralized and acce...

passing DB Connection object to methods

Was wondering if it is recomended to pass a database connection object around(to other modules) or let the method (in the other module) take care of setting it up. I am leaning toward letting the method set it up as to not have to check the state of the connection before using it, and just having the caller pass any needed data to the c...

Multiple database support in django.

From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet. Can anyone please tell me how one can achieve multiple database connections in Django. Does anyone have any idea by when Django will fully/officially support Multiple database connections. ...

How to handle: Communication link failure

Hello, We're using Spring 2.5.4/Hibernate 3.2/Websphere Application Server 6.1.0.17. We've deployed the application on an AIX box. The next day when I come in, I try to log into the application. I get this exception on the page: Error 500: Request processing failed; nested exception is org.springframework.dao.DataAccessResourceFailu...

How do I connect to SQL Server using Emacs?

What steps do I take? Any gotchas to be aware of or tips to enhance the IDE experience that are specific to SQL Server when using Emacs? ...

Is it acceptable to keep a db connection open for the life of the page?

Everybody knows that you should close a connection immediately after you finish using it. Due to a flaw in my domain object model design, I've had to leave the connection open for the full page life cycle. Essentially, I have a Just In Time property which opens a connection on first call, and then on Page.Unload (..) it would check if ...