<font color =red>Where is the JDBC url in datasource</font>
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sabu_vs
Posted On:   Monday, May 20, 2002 04:02 AM

Hi For database connection I use Class.forName("driver name"); for loading the driver and DriverManager.getConnection(jdbcurl) to connects to the particular database using the jdbc URL. But when using a Datasource the code used is follows VendorDataSource vds = new VendorDataSource(); vds.setServerName("my_database_server"); vds.setDatabaseName("my_database"); vds.setDescription("data source for inventory and personnel"); Context ctx = new InitialContext(); ctx.bind("jdbc/AcmeDB", vds); Here there is no steps li   More>>

Hi



For database connection I use Class.forName("driver name");

for loading the driver and
DriverManager.getConnection(jdbcurl)

to connects to the particular database using the jdbc URL.



But when using a Datasource the code used is follows




VendorDataSource vds = new VendorDataSource();

vds.setServerName("my_database_server");

vds.setDatabaseName("my_database");

vds.setDescription("data source for inventory and personnel");


Context ctx = new InitialContext();

ctx.bind("jdbc/AcmeDB", vds);






Here there is no steps like loading a database driver and connecting using a jdnbc URL

Could you pls advice


thanks


sabu

   <<Less
About | Sitemap | Contact