What does JNDI's lookup of JDBC 2.0 DATASOURCE return?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   arul_joseph
Posted On:   Monday, October 7, 2002 10:42 PM

Hi, I have configured a Datasource in an application server and have registered it to its naming system( say WEBLOGIC). 1. If i lookup this Datasource object what gets returned? will a copy of this object be created on client machine or a remote reference sent to client? if a remote reference is sent, by what mechanism does the client object interact with this bound object in app server(rmi???) 2.Every datasource requires a driver.I i use type driver, say ORACLE OCI driver, therfore i need to install driver and OCI NATIVE LIBRARY FILES in appserver. If datasource object is sent to client system during lookup, how will work?There are no OCI native library files in client. Its there only in apps   More>>

Hi,
I have configured a Datasource in an application server and have registered it to its naming system( say WEBLOGIC).

1. If i lookup this Datasource object what gets returned?

will a copy of this object be created on client machine or a remote reference sent to client?

if a remote reference is sent, by what mechanism does the client object interact with this bound object in app server(rmi???)

2.Every datasource requires a driver.I i use type driver, say ORACLE OCI driver, therfore i need to install driver and OCI NATIVE LIBRARY FILES in appserver.

If datasource object is sent to client system during lookup, how will work?There are no OCI native library files in client. Its there only in appserver?

I AM CONFUSED. CAN ANYONE PLS HELP ME
THANKS

   <<Less

Re: What does JNDI's lookup of JDBC 2.0 DATASOURCE return?

Posted By:   jaivir_singh  
Posted On:   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 .



Cheers

Jaivir.
About | Sitemap | Contact