NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Re directing Persistence Units after compliling (Jndi.properties file too)

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
rdblaha1
Posted via mailing list.





PostPosted: Mon Dec 15, 2008 7:57 pm    Post subject: Re directing Persistence Units after compliling (Jndi.properties file too) Reply with quote

Newbie to persistence type question.

For my standalone client I do some database access to the database on my
server with persistence and therefore I have a persistence.xml file. I also
use JMS for point to point messaging from my client to the server, therefore
I also have a jndi.properties file (easier to change, but still wrapped up
in the jar file).

I have need of compiling a NB6.5 project only once, then with only necessary
changes to my client persistence.xml file redirect to a different server
and/or database, e.g. one server/database for programming, another for
test/QA, and a different one for each customer, etc. Since the xml file is
compiled into the project jar file this is not necessarily easy (as far as I
can tell) to change the included persistence.xml file for each separate
setup.

Since this shouldn't be an isolated case for us, can someone point me in the
right direction with a link to online documentation explaining this, or
someone with experience doing this would be of great benefit also.

Thank you.
rdb

--
View this message in context: http://www.nabble.com/Redirecting-Persistence-Units-after-compliling-%28Jndi.properties-file-too%29-tp21020787p21020787.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
rdblaha1
Posted via mailing list.





PostPosted: Tue Dec 16, 2008 2:46 pm    Post subject: Re directing Persistence Units after compliling (Jndi.properties file too) Reply with quote

rdblaha1 wrote:
Quote:

Newbie to persistence type question.
point me in the right direction with a link to ... documentation
explaining this


While waiting patiently for an answer I realized I had one source available
in hand. I am now reading:
Pro EJB 3 Java Persistence API, Mike Keith and Merrick Schincariol, Apress
c 2006
Chapter 11 Packaging and Deployment

If I get no other responses to my initial query, I will post what I find.
If I am incorrect I am sure help will be readily available.




--
View this message in context: http://www.nabble.com/Redirecting-Persistence-Units-after-compliling-%28Jndi.properties-file-too%29-tp21020787p21033996.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
junyingfan



Joined: 30 Sep 2009
Posts: 2

PostPosted: Wed Sep 30, 2009 8:46 pm    Post subject: Have you have solution for this? Reply with quote

I have similar case. I feel using jndi is the way for this but I don't know how to set up using jndi in persistence.xml. I added
<jta-data-source>java:comp/env/jdbc/myDB</jta-data-source>
and remove some property for direct database connection (like username,driver_class,password,url)
but I got exception conplain invalid persistence.xml

Could you let me what is your solution?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo