-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Connecting to WAS Datasource
PostPosted: Thu Aug 19, 2004 9:14 am 
Newbie

Joined: Thu Aug 19, 2004 9:05 am
Posts: 7
Hi,

I am trying a Hibernate Tutorial in OnJava. It says Hibernate.properties should be like this:

hibernate.connection.username=sa
hibernate.connection.password=
hibernate.connection.url=jdbc:hsqldb:/home/davor/hibernate/orders
hibernate.connection.driver_class=org.hsqldb.jdbcDriver
hibernate.dialect=net.sf.hibernate.dialect.HSQLDialect

My question is: if I use WSAD and have a datasource setup by JNDI name "jdbc/test"

a) how do I specify this in this properties file.
b) do I need to specify username and password in this file (all this info is already there in WAD datasource). And is it a good idea to store password as plain text in this file?? This is normally against corporate security policy???

Hope to get your answers.

Thanks,

Sanz


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 19, 2004 9:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
a) please read the reference manual and look at the example hibernate.properties in the hibernate distribution
b) No. See a)


Top
 Profile  
 
 Post subject: WAS ds
PostPosted: Thu Aug 19, 2004 10:31 am 
Newbie

Joined: Thu Aug 19, 2004 9:05 am
Posts: 7
Thanks. I did and getting the following exception:

net.sf.hibernate.HibernateException: Could not find datasource
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:48)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:65)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
at com.pioneer.test.dax.TestMeHandler.main(TestMeHandler.java:30)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:652)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:255)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:292)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:44)
... 5 more
Exception in thread "main"


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.