DataSource problem
From: datanet (okip_at_astron.hu)
Date: 02/13/04
- Next message: Andy Fish: "Re: DataSource problem"
- Previous message: UGENT: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Next in thread: Andy Fish: "Re: DataSource problem"
- Reply: Andy Fish: "Re: DataSource problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Feb 2004 11:32:03 +0100
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
- Next message: Andy Fish: "Re: DataSource problem"
- Previous message: UGENT: "Re: Create Access databases programmatically via JDBC-ODBC?"
- Next in thread: Andy Fish: "Re: DataSource problem"
- Reply: Andy Fish: "Re: DataSource problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]