• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JNDI mapping in Weblogic

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a datasource with the JNDI name of DS. In my code I use "java:comp/env/jdbc/DS" as the lookup string. I get an error stating that comp/env/jdbc was found but not DS.
I have also tried prepending the JNDI name with com/env/jdbc/. It then shows up in the JNDI tree under those directories but when I run the web app I get the same error above indicating that the com/env/jdbc directory I have created is not the real one.
Any ideas?
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the following code to solve your problem:
public static DataSource objDataSource= ctx = new InitialContext();
DataSource objDataSource = (DataSource) ctx.lookup ("DataSourceName");
Regards,
Milind
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you set up the connection pool and data source, did you Target it to the server? Check the Targets tab in the console for these things to make sure.
If its not "targeted", then it is just configured but not actually running anywhere.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
try this on your config file
<JDBCDataSource JNDIName="myDataSource" Name="myDataSource"
PoolName="myDataSource" Targets="myserver"/>
This is for the pool cos the datasource would refer to a jdbc connectoin pool
<JDBCConnectionPool CapacityIncrement="2"
DriverName="weblogic.jdbc.informix4.Driver" InitialCapacity="5"
MaxCapacity="25" Name="myDataSource"
Properties="user=;db=;port=;password=;server="
Targets="myserver" URL="jdbc:weblogic:informix4 ool@server ort"/>
regards
riaz
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic