Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2004, 08:11 AM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Best way to connect to mySQL

Hello.
I have an application which connect to mySQL server. I would like to Know which is the best way to do it.
1. Connect one time at the beggining (what I do)
or
2. Every time I need to make a query connect against to the server.

In the first step the problem will be how to store the dbUrl, user, password throughout the application.
In the second case how I ask the dbUrl, user, password every time I need.
I would like to know a strategy to do this kind of step.
Thanks.
 
Old April 5th, 2004, 06:37 AM
Authorized User
 
Join Date: Aug 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

for the first step use a properties file to hold all the information you want.

for the second use a form to get the input from a user.

or you could just hard code it all.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect php to mysql Nicholsen MySQL 1 December 3rd, 2006 02:34 AM
Trying to connect to Mysql tp194 Classic ASP Databases 4 November 11th, 2004 12:12 AM
can't connect to mysql using pear sam PHP Databases 2 September 18th, 2003 04:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.