Re: What does JNDI's lookup of JDBC 2.0 DATASOURCE return?
Tuesday, October 8, 2002 12:04 AM
Hey you r too confused sir .Let me try n help you out . This is the way I would normally do a lookup.
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/myDb");
Connection con = ds.getConnection();
Now here as you can see , lookup() return an object , which I typecast to datasource , and then I ionvoke the getConn method.
Now this datasource object that you have is actually a stub and the methods you invoke on it , will be delegated to the skeleton , on the server .
That skeleton in turn will invoke the getConnection method of tha datasource on the server , which will return a connection object .
That conn obj will be delegated back to the stub by skeleton , and the remote caller recieves a conn object .But this conn object is actually not a physical conn object instead is just a handle to a physical conn at the server
Now trying to answer your last question , what if you are using type 2 drivers . Well if you would have been using type 4 than there wpuld have been no probs but as you are using type 2 still there should not be any probs ,COS' THE CONN U RECIEVE IS A HANDLE ,and that should simply delegate your actions to the physical conn at the server , and at the server , U WILL NEED TO HAVE A Oracle Client.
Hope this helps you .Last answer is just logical , so if you happen to implenent this , let me know what your outcome is .