Hibernate DataSource Properties

What are the properties in DataSource Explain? also explain hibernate properties?

Showing Answers 1 - 3 of 3 Answers

Manisha

  • Mar 22nd, 2016
 

DataSource objects, which are the preferred means of getting a connection to a data source. DataSource objects can provide connection pooling and distributed transactions.

Objects instantiated by classes that implement the DataSource represent a particular DBMS or some other data source, such as a file. A DataSource object represents a particular DBMS or some other data source, such as a file. If a company uses more than one data source, it will deploy a separate DataSource object for each of them. The DataSource interface is implemented by a driver vendor. It can be implemented in three different ways:

- A basic DataSource implementation produces standard Connection objects that are not pooled or used in a distributed transaction.

- A DataSource implementation that supports connection pooling produces Connection objects that participate in connection pooling, that is, connections that can be recycled.

- A DataSource implementation that supports distributed transactions produces Connection objects that can be used in a distributed transaction, that is, a transaction that accesses two or more DBMS servers.

Properties for Data source are:
< !-- Database connection settings -- >
< property name="connection.driver_class" >org.postgresql.Driver< /property >
< property name="connection.url" >jdbc:postgresql://localhost:5432/postgres< /property >
< property name="connection.username" >postgres< /property >
< property name="connection.password" >root< /property >

These properties are used for configuring the DB as the data source so that JNDI can provide proper connection to the application.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions