D
datanet
Hi,
I would like to use javax.sql.DataSource to connect to the database from a
simple application.
I have the next program fragment:
Context initctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)initctx.lookup(
"java:comp/env/jdbc/MyDatabase");
java.sql.Connection cx = ds.getConnection(user,password);
I do not know how what "java:comp/env/jdbc/MyDatabase" means and how to set
the database url, the jdbc driver and so on.
I have read many documents but I cannot find the solution. Can anybody help
me?
Okip
I would like to use javax.sql.DataSource to connect to the database from a
simple application.
I have the next program fragment:
Context initctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)initctx.lookup(
"java:comp/env/jdbc/MyDatabase");
java.sql.Connection cx = ds.getConnection(user,password);
I do not know how what "java:comp/env/jdbc/MyDatabase" means and how to set
the database url, the jdbc driver and so on.
I have read many documents but I cannot find the solution. Can anybody help
me?
Okip