-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Asaf,

Asaf Paris Mandoki wrote:
> I'm planning to make an application that uses a MySQL Database.
> 
> Should I have a persistent object with a persistent connection to the
> database or is it better to create the connection each time i use it?

It really depends on what your application needs to do. For instance, if
your application needs access to the database only sometimes, you might
want to open the connection only when you need it. On the other hand, if
you need information from the database all the time, you should
definitely use a connection pool (see another response).

If you need to login to the database with the credentials of individual
users, then you don't really have a choice: you'll need to open a
different connection for each user (unless your JDBC driver offers a way
to switch users after a generic connection is made or something like that).

Most webapps use connection pools because they need constant access to
the database and are able to use an "application" user to connect.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSGC59CaO5/Lv0PARArGQAJ0VpI0hkjfbON5ISKR6abNpOywKeQCaA/j7
dZQvCyYEt4b5qUs51M+Iucw=
=GPG0
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to