openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Prud'hommeaux <mprud...@apache.org>
Subject Re: Need help
Date Mon, 14 May 2007 16:11:52 GMT
Sanku-

If you look in Main.java, you can see we are passing the System  
properties to the EntityManager creation process:

         EntityManagerFactory factory = Persistence.
             createEntityManagerFactory("hellojpa",  
System.getProperties());

In the parent directory's build.xml file, you can see we pass system  
properties to the <java> process that declares the database driver,  
URL, connection name, and password.

This step of indirection might be a bit confusing, but it does allow  
you to easily swap out properties for some other database you want to  
test by just specifying them on the command line. E.g., something like:

   ant -Ddbdriver=com.somecompany.Driver -Ddburl=jdbc:somedburl - 
Dbuser=myuser -Ddbpass=somepass

Of course, you can always just un-comment the <properties> section of  
the persistence.xml and not bother passing the system properties to  
the creation process as well.



On May 14, 2007, at 2:14 AM, <subrahmanyam.sanku@accenture.com> wrote:

> Hi JPA Team,
>
>
>
> I am trying to learn JPA and thanks for your efforts to develop the  
> JPA.
>
>
>
>
> I am trying to execute the sample program given in 5 minute quick  
> start
> guide to OpenJPA <http://incubator.apache.org/openjpa/quick- 
> start.html>
> . I am able to execute and see the result in console. But how to  
> connect
> to Derby database which is comes along with the package.  In
> persistence.xml I found that you open the connection. But how to  
> connect
> derby database and see the data in the  table Message (since we are
> creating & inserting into the Message table).
>
>
>
>
>
> Thanks,
>
>
>
> Regards
>
> Sanku Subrahmanyam
>
> Accenture - Bangalore
>
> Ph  : 080 4106 2113
>
> Mob: 9886623009
>
>
>
>
>
> This message is for the designated recipient only and may contain  
> privileged, proprietary, or otherwise private information.  If you  
> have received it in error, please notify the sender immediately and  
> delete the original.  Any other use of the email by you is prohibited.


Mime
View raw message