Monday 16 December 2013

Instead of lportal if we connect liferay to another database

Connection with my mySql database

To connect with any database we have to configure portal-ext.properties file.
To connect with mySql database we have to add the below codes in portal-ext.properties file


# MySQL
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=
#MySQL configuration end
    * Here lportal is the default database of Liferay.
If we want to use another database(containing tables/not software) suppose the name of our created DB  name is creed then to connect our application with this DB we have to write the code in liferay-ext.properties file
jdbc.default.url=jdbc:mysql://localhost:3306/creed?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
   Change are highlighted by blue font color with bold and underline.
   Now when this time we run our server then it will connect with creed DB, in this process Liferay will connect with this DB and it will check that the default table(internally) used by Liferay is present or not. At first time the default tables present in Liferay will not present so at very first time it will creates all default tables and then connect with creed DB.
     Here we create a database. Here database means not software like Oracle, Mysql or SqlServer. It means we create our database which contains lots of tables.  

No comments:

Post a Comment