• 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

accessing JNDI name

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

we have created connection pool in bea weblogic7.0. in java files we have hardcoded jndi name to access this connection pool, whenever we change jndi name i have to modify in java files and recompile it again,its risky process,is there any other way to achieve this, even if i change jndi name i should not recompile the java files.

Thanks
Suresh
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Weblogic forum.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suresh,

I think the best solution is to use property file where You will store all your application parameters.

then in java code:


The fastest one is to pass this jndi_address to java as argument. For example:

in the Weblogic Server Start Script. And then in the java code:


Best Regards,
KArol Muszynski
[ September 23, 2005: Message edited by: KArol Muszynski ]
 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tthanks
 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you explain how to do the second step(passing parameters)

Thanks
Suresh
 
suresh pulapally
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you explain how to do the second step(passing parameters)

Thanks
Suresh
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by suresh pulapally:
Hi All,

in java files we have hardcoded jndi name to access this connection pool, whenever we change jndi name i have to modify in java files and recompile it again,its risky process,is there any other way to achieve this, even if i change jndi name i should not recompile the java files.



You also can get the hostname programmatically using the API
String hostName = InetAddress.getLocalHost().getHostName();

So you can use it to construct t3://<hostname>:17001

hope this will solve your problem.

Thanks,
Santosh
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of Course , it's a good way to make configurable the data source in some where like properties file.

Why not you use xDoclet to automatically generate descriptor files ?

I don't think that you have to compile your java classes.
because this information is contained by descriptor files.
If you change the descriptor files and redeploy the application, It will also do the same thing.
 
reply
    Bookmark Topic Watch Topic
  • New Topic