cancel
Showing results for 
Search instead for 
Did you mean: 

Embed Postgresql In my application(java)?

Level 2 Adventurer

Embed Postgresql In my application(java)?

I have application which is loading data to Postgresql database. As of now , I set postgresql database as of one my prerequisite for my application deployment in client places.  I am looking for a way to ship my application with embedded postgresql database. Can anyone help on this scenario.

Note : I already tried out shipping applications by embedded databases such as sqllite and h2 database.

 

This project predominantly needs postgresql at it backend so can anyone help on this .

Tags (1)
3 REPLIES
Moderator

Re: Embed Postgresql In my application(java)?

Unfortunately, Postgres is not really embed-able into an application, in the sense that h2 and sqlite are embedded databases.  Postgres is designed to be used in a client-server fashion, and will have to run in the background as a separate process.  If you really need to use postgres, I suppose you could include an initdb into your application installation process, such that when you start/run your application, it can spawn a Postgres process, do the work needed, then shut it down when you quit the application.  However, I think you may run into some performance issues, since you'll need to spend time waiting for Postgres to start up/shut down.

 

I'm curious, however--what are the features in your application that make Postgres a requirement?

 

HTH,

--Richard

Level 2 Adventurer

Re: Embed Postgresql In my application(java)?

Richyen,

 

 

I have lot more queries doing recursive operations over data which can contain circular loops. In postgresql , we can make use of array concept to avoid the infinite loops. If i need to move the same code to h2 or sqlite, i need extra some efforts to find the equivalent and testing of my applications.. 

 

Can you help me , how to automate the installation of postgresql without manual interventions ? 

Highlighted
Moderator

Re: Embed Postgresql In my application(java)?

ashifahameda wrote:

 

Can you help me , how to automate the installation of postgresql without manual interventions ? 


Seems like you were able to find a way to automate your installation of Postgres, as per your post in another thread.  Let me know if you need any further help!