How to connect postresql database in allinone projects

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

How to connect postresql database in allinone projects

Hi

I have configured 'allinone' projects in my system but i don't have alfresco community installed in my system.I believe the project will get connect to tomcat runner internally and by default it will be connected to H2 database.but if i want to connect to other databases such as postresql,mysql etc, where i can define the connection properties. As i am aware of that if we install alfresco community, by default we can configure database in alfresco-global.properties file, but i want to create the project independently for development purpose, ie.  no need to install alfresco, so where will i configure the database connections ? if i need the alfresco-global file to be added where i have to place the file?

Please guide me to understand on that. Thanks in Advance

4 Replies
Senior Member II

Re: How to connect postresql database in allinone projects

It depends on which alfresco SDK you are using.

If your SDK is below 3.0.0 than

  • You need to make changes in alfresco-gloabl.properties to change the db confiuration like db.port,dbusername etc.
  • You need to grabe driver as well from maven  central repository and include it in pom file.

If your SDK is above 3.0.0 than

  •   You can simply change configuration in alfresco-global-postgresql.properties with the db configuration which i mentioned above.
  • You need to change properties in POM file. like making maven.alfresco.enableH2 as false and making maven.alfresco.enablePostgres as true
Active Member

Re: How to connect postresql database in allinone projects

Hi Krutik,

I am using SDK 2.2.0 Allinone alfresco project,as per your point, where i can find the alfresco global properties file ? if i am correct, this is the path where alfresco-global.proprties file located

C:\alfresco\alfresco\alfresco-repo-amp\target\amp\config\alfresco\module\alfresco-repo-amp\alfresco-global

and how to grab driver and include it in pom?can you guide me on that?

Senior Member II

Re: How to connect postresql database in allinone projects

You should not update anything inside target folder.I think below should be location of the file

src\main\amp\config\alfresco\module\${module.id}\alfresco-global.properties

Active Member

Re: How to connect postresql database in allinone projects

I updated the alfresco-global.properties file with postgres db connection properties, but still getting error and while compiling it shows db connected to H2 database.

if i am correct,normally the file located in tomcat/shared/classes folder, which will overrides the properties given in project and execute it, but in my case alfresco community is not running, so where i can define the database connection properties?Any suggestion would be appreciated.