I apologise if I say something stupid here since I have no experience in
EJB. I have a standalone
java program that reads an excel workbook, converts it to XML and then inserts the XML data into database. Now I have been able to connect to the Oracle database using thin driver and URL.
The client has Webspeher running on the machine where this standalone application would reside (note that the app would *not* be deployed on WAS, it would be on the same *machine*). Since the App server already has a pool to the same database I want to use to use the same using JNDI. How can I use the JNDI? My code looks something like this:
Currently the code is on my machine while the WAS is running on some other machine on our LAN. I am getting error
javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory probably beacuse I do not have the classes for JNDI here on my machine.
My questions are:
(1) Is it possible for a stand-alone java program to connect to a remote database using JNDI?
(2) If yes does the program need to have the jar containing the "WsnInitialContextFactory" on client machine as well?
(3) Should this application be put somewhere inside folder of WAS which are in classpath (say bin or something), will then only it run?
I would really appreciate your replies. Thanks for your valuable time.