Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.sql.DataSource query?

 
Jignesh Gohel
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using following code to creating connection pool.



Now i want to know that when i am using the same code in a simple class and compile it in jdk 1.3 version. i am getting compiler error.While when usingthe same code in a jsp page and executing that page in a web serveror application server it is working fine.

So can anybody please explain me what is happening??

Thanks,
Jignesh
[ August 07, 2006: Message edited by: Bear Bibeault ]
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you get some error regarding to your classpath .
can you pleas post the compiler error here ? after people here see the compiler error they can help you more effectively.
 
mnadeem chishti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory
PROVIDER_URL=t3://" + "IP:PORT

put these properties in a text file let say dsproperteis.properties
now use the following code to lookup your datasource

Properties p=new Properties();
try {
p.load(new FileInputStream("dsproperteis.properties"));
System.setProperties(p);
// lookup your datasource here
}
catch (Exception e)
{
e.printStackTrace();
}

take care while providing the properties file.
put it in the same location where your class contianing main method is placed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic