Liferay using PostgreSQL? - java

How can use of database PostgreSQL in Liferay and connection therewith, reading, programming in the VM to display contents of the database.

There are following two way using which you can change liferay database.
At start up liferay provides the option using which we can change liferay database.
Following is the steps for the same.
1.1) Create a database in postgresql(like lportal).
1.2) Select the change database option at liferay start up.
1.3) Enter your databse url,username and password.
1.4) To run the liferay setup again you just need to change the following property in portal-setup-wizard.properties((check attached screen shot for path of this file)
Change the following value false to true
setup.wizard.enabled=true
1.5) When you will run the sever it will ask you for the admin user configuration and exactly below that there is option to change the database using which you can change the database.
OR
You can create a file with name portal-ext.properties in Liferay root folder(check attached screen shot).
Add following database configuration.
#
# Postgresql
#
jdbc.default.driverClassName= Postgre Drive
jdbc.default.url= Database url
jdbc.default.username= database username
jdbc.default.password= database password
For more details check following url
http://www.liferay.com/community/wiki/-/wiki/Main/Database+Portal+Properties
Hope it may help you.!!

Related

How can I turn off logging in HSQL DB with URL parameter?

I am using java-ee application running on wicket.
The problem is, that the connection to the HyperSQL database with JDBC creates a huge log file *.log. Example of my URL:
jdbc:hsqldb:file:C:\database\text;hsqldb.sqllog=0;hsqldb.applog=0
I need to turn off the logging with some jdbc url parameter. I have tried these:
hsqldb.sqllog=0;hsqldb.applog=0;
That is not working, so I have tried this combination:
hsqldb.log_data=false;hsqldb.reconfig_logging=false
But with these parameters, when I stop the app, the data disappears.
The text.log file is the record of transactions performed on your database. If you disable it with hsqldb.log_data=false the transactions are not persisted to disk. The name is derived from the file name on your database URL.
The hsqldb.sqllog and hsqldb.applog settings are for diagnostics and default to 0.
The hsqldb.reconfig_logging=false is also for diagnostics and works together with hsqldb.applog setting. These settings are discussed in the Guide: http://hsqldb.org/doc/2.0/guide/management-chapt.html#mtc_monitoring_operation
So if you want your data to survive when your app shuts down, you should not disable the default log. See http://hsqldb.org/doc/2.0/guide/management-chapt.html#mtc_cache_persistence on how to reduce the size of the text.log file.

Java ADF application don't read data correctly from oracle 9i DB with ISO8859-6 encoding

I created an application in Jdeveloper and Oracle-ADF framework with JSF page extension.
The connection is oracle 9i Database with ISO8859-6 encoding
when i run the application it shows the data incorrectly like this
"أجازة غٍد اف�ظر "
any body can help to fix this?
Check the compiler encoding in your project properties.
Also check the character set setting in your JSF page.

Unable to insert rows into H2 database from Hibernate project

I am creating a Hibernate project in IntelliJ IDE and trying to hook it up with a H2 database. I created the project based upon this tutorial:
http://www.roseindia.net/hibernate/hibernate4.2/hibernate-example-step-by-step-in-eclipse.shtml
The only change I'm making is the database, instead of MySQL, I'm using H2. However, when I'm trying to run the application, the insertion to the database is shown to have been successful, but there are no signs of any such rows when I open up the database in the H2 console. I've tried many solutions suggested here and elsewhere, including this, this and this. I've tried changing the connection URL of the database in the hibernate.cfg.xml file from a relative path to absolute path, but to no avail. I'm attaching a screenshot of my hibernate.cfg.xml and the relevant portion of the log below. Please help me out with this.
your hibernate.connection.url should be something like that jdbc:h2:tcp://localhost/mem:playground I am assuming you are starting the H2 database out of your project, as you are connecting to H2 via console.

How to create a MySQL database for DataNucleus

I need to setup a MySQL database for a DataNucleus properties file:
javax.jdo.PersistenceManagerFactoryClass=org.datanucleus.api.jdo.JDOPersistenceManagerFactory
datanucleus.metadata.validate=false
# Enable these lines if persisting to ODF
#javax.jdo.option.ConnectionURL=odf:file:tutorial.ods
#javax.jdo.option.Mapping=odf
# Enable these lines if persisting to RDBMS (HSQLDB)
javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
javax.jdo.option.ConnectionURL=jdbc:mysql://myserver.com:3306/myDb
javax.jdo.option.ConnectionUserName=userName
javax.jdo.option.ConnectionPassword=password
# javax.jdo.option.Mapping=hsql
datanucleus.autoCreateSchema=true
datanucleus.validateTables=false
datanucleus.validateConstraints=false
Can anyone please tell me the steps on how to set it up for this particular purpose?
Since you have autoCreateSchema enabled, you do not need to create the schema. All you need to do is create the database itself. Install mysql if necessary, log in to mysql as root and then issue the create database command. If you do not have root access, consult the documentation or the administrator for your server. You can find many tutorials online for this task, please read them before asking further questions.

how to embed javadb or hsqldb into java application with hibernate using netbeans?

I successfuly embedded javadb in my application using the classpath ,but here's the problem : I want hibernate to be able to work with the database,but I always get an error in netbeans sayng "enable to establish connection ".
AnyHelp please ?
The URL for a local HSQLDB database is jdbc:hsqldb:file:file_path_name The file_path_name is usually an absolute path with a name at the end. The database engine will then create a few files with the given name, but predefined extensions. An example of this is: jdbc:hsqldb:file:/mydata/mydb which will produce mydb.properties , mydb.script and a couple other files in the /mydata directory.

Categories

Resources