• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does JPA spec include methods for connection?

 
Leslie Baker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm an ERP developer that's been tasked with doing some Java EE development for the first time. Gulp. Trying to come up to speed as quickly as possible. We'll be using JPA for the persistence layer on a sql server 2005 db. Would I establish the db connection through JPA classes and methods? Or would I use jdbc libraries to get that connection?

Thanks.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn!

You'll put your connection information in a file like this:



-From Tutorial on Setting Up Hibernate


When you programatically invoke the basic JPA components, that file will be read, and your JPA provider, such a Hibernate, will establish the JDBC connection for you.

Keep the questions coming!

-Cameron McKenzie


 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Leslie,

in short JPA is a database abstraction on a much higher level than JDBC. In theory you don't have to worry too much about connections, databases and the technical low-level stuff.

The first steps to use JPA would be to create entity classes which represent entities of the problem domain you are modeling. The "tool" to deal with the database stuff is the so called EntityManager which offers basic CRUD functionality and more.

That said you can probably imagine that there's a lot more to this topic. But for your first steps you should have some information to Google for

Marco
 
Leslie Baker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, thanks for the info. After learning more about the project, there's a web service I call to get my connection string, user and password. I'll then use this to make the jdbc connection call.

I'll be doing the entity modeling using JPA eventually, so I'm sure I'll have more questions soon.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic