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 ?
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.