how to access

hihow can i establish connection to database on the basis of password bye
[101 byte] By [samreengul] at [2007-9-26 4:19:22]
# 1
See Javadoc for javax.sql.DataSource.getConnection("username", "password")
neville_sequeira at 2007-6-29 17:21:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
hithanx 4 ur replyi have tried it but that doesnot workeven i try it through properties class alsobye
samreengul at 2007-6-29 17:21:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

If using JDBC 2.0 compiliant datasource, then javax.sql.DataSource.getConnection("username", "password") and otherwise, the plain old java.sql.DriverManager.getConnection(url, "username", "password") has always worked for me.

Can you be more specific ? What are the symptoms that make you conclude that it doesnot work ?

neville_sequeira at 2007-6-29 17:21:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
hithanx 4 ur replybut that also doesnot work as i have tried thisi mean that before conecting to database it is not asking abt password how it will take thisthanxbye
samreengul at 2007-6-29 17:21:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

Probably you have to configure your DB to listen

onto user account and password

What our friends described on the previous emails

ist what works.

I have experience using this concept with:

- mySQL

- msql

- PostgreSQL

- Oracle

and this works fine.

Properties p = new Properties();

p.put("user",user);

p.put("password", password);

con = DriverManager.getConnection(url,p);

And that's it.

FredyF at 2007-6-29 17:21:55 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...