Lookup from Standalone Client
Friday Oct 26, 2007
My previous blog was about accessing a JDBC resource from an ejb.
This blog talks about accessing the JDBC resource i created in the last blog, from a standalone client.
I use the same configuration from my previous blog : jdbc/cactus for my resource that needs to be accessed.
My sample will have the following code:
InitialContext ctx = new InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/cactus"
Connection c = ds.getConnection();
insert(......);
c.close();
Compile the sample
Run the sample
Note the included jars in the classpath
- appserv-rt.jar
- javaee.jar
- appserv-admin.jar
- imqjmsra.jar
- derbyclient.jar
Also, observe the system properties for the server host and naming service port.













that does not explained everything i'm sorry but d...