-
Nov 14th, 2012, 01:31 AM
#1
[RESOLVED] Persistence Unit
Hi,
I am on my Windows 7 Professional laptop using Netbeans 6.9 to do my Java homework which requires the use of a Persistence Unit. However, the connection to the database isn't recognized and when I go to create "New Data Source" and fill in the appropriate information then press "OK" the new Data Source does not appear in the list. Why is this?
Thanks,
Nightwalker
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Nov 18th, 2012, 02:47 AM
#2
Re: Persistence Unit
After taking the following steps to try and rectify the problem I had to manually edit the presistence.xml file and change the needed fields.
1. Create a new Java web project
2. Create a new database
3. Connect to database
4. Create a new "Entities" package
5. Add a new Entity class
6. Create persistence unit
7. Select provider and data source ( or create new data source)
xml Code:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="WebApplication2PU" transaction-type="JTA"> <provider>oracle.toplink.essentials.PersistenceProvider</provider> <jta-data-source>jdbc/test</jta-data-source> <properties> <property name="toplink.ddl-generation" value="create-tables"/> </properties> </persistence-unit> </persistence>
I think in more cases the above steps will still work. Although, I'm still at a loss as to why the problem occurs.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|