File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes MySql Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MySql Connection" Watch "MySql Connection" New topic
Author

MySql Connection

nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
hi,
I would like to talk to my MySql server on the local machine (4.0.15-nt) by giving the userid and password from the java program.
As of now I am able to connect to the Mysql server by using only the url in the code
Connection conn = DriverManager.getConnection(url).
I want to give the userid and password.
Kindly let me know.
PS: I connect to the MySql server by.....
C:\mysql\bin\mysql I dont give the userid and password,
How do I go about doing this,
help would be appreciated

thanks
nash
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I would like to talk to my MySql server on the local machine (4.0.15-nt) by giving the userid and password from the java program.
Take a look at the DriverManager class documentation. Notice that the getConnection method is overloaded. One version takes a url, a user, and a password (all as Strings).
I connect to the MySql server by.....
C:\mysql\bin\mysql I dont give the userid and password,
How do I go about doing this,

Are you asking how to secure a database in MySQL?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
nash avin
Ranch Hand

Joined: Nov 13, 2003
Posts: 96
hi,
I want to know how to go about doing a secure connection to a database server (MySql 4.0.15-nt),that is provide a username and password so that I could connect to it.
Let me know
Thanking you
nash
Nehul NN
Ranch Hand

Joined: Nov 05, 2003
Posts: 45

Hope this help.
--Nehul
SCJP1.4
SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySql Connection