• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Run a cllient without using launchClient utility

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there anyway in WebSphere 5 to run an Application client without using the launchClient utility? The application client needs to look up the datasource that's defined in WebSphere, but the application client might not run on a WebSphere box. So launchClient is not available.

Note that the provideURL currently is "corbaloc:iiop:localhost:2809", but it could be some remote machine's IP address.

<code>
Hashtable params = new Hashtable();
String providerURL = "corbaloc:iiop:localhost:2809";

params.put(Context.PROVIDER_URL, providerURL);
params.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
InitialContext ctx = null;
DataSource ds = null;

try {
ctx = new InitialContext(params);
/*BLOWING UP HERE */
ds = (DataSource) ctx.lookup("jdbc/myDatasource");
myDataSources.put(resRefName, ds);
}
catch (NamingException ne)
{
ne.printStackTrace();
throw new DatabaseException("Unable to find a DataSource for " + resRefName + " due to " + ne.getExplanation());
}
</code>

Any idea? Thanks!

 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Keying Xi:
Is there anyway in WebSphere 5 to run an Application client without using the launchClient utility? The application client needs to look up the datasource that's defined in WebSphere, but the application client might not run on a WebSphere box. So launchClient is not available. Any idea? Thanks!

[ June 11, 2004: Message edited by: Keying Xi ]



The quick answer is no. Only the J2EE application client (launchClient) can access data sources, and then only when a V4 datasource is used (read in the infocenter about the application client resource configuration tool).

Now, having said that, you can install the application client container on any machine -- you don't need to install all of WebSphere -- that's actually a configuration option in the WAS install screen. Also, once you've installed the entire thing on one box you can copy it to other machines as necessary...

Kyle
 
forum guest
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying, Kyle.
 
reply
    Bookmark Topic Watch Topic
  • New Topic