Currently in my Grails project I am using PostgreSQL database so I thought to share my knowledge with everyone. I am using it on Linux operating system. I am mentioning all the steps that I followed to integrate PostgreSQL with Grails . Step 1: Install PostgreSQL on your system To install postgreSql [java] sudo apt-get install...
Recently in one of my project i faced a problem that database was having special character, which is shown as space on the User Interface. So as to solve this issue i found a very simple solution which consists of following steps: 1. First, you just need to identify which type special character to be removed/replaced like in my case...
Hi, Recently i had a use-case where we have the legacy database and it contains the corrupted references of a non existent record in many-to-one relationship, and i have to populate a grid that contain info also from referenced record. As referenced record doesn't exist, So when we refer to the certain record will result in...
Hi all, Here is a simple function that can allow you to clear time from the DATETIME field of your database table [sql] DROP FUNCTION IF EXISTS cleartime; delimiter // CREATE FUNCTION cleartime(dt datetime) RETURNS DATETIME NO SQL DETERMINISTIC BEGIN DECLARE t varchar(15); -- the time part of the dt ...
Hi, Recently i was in a situation where i need to take the dump of particular records in mysql. We are pretty much familiar with the normal mysqldump statement given below : [sql] mysqldump --user=usr --password=pwd database_name table_name > dumpFile.sql; [/sql] The above statement will provide us the dump of the...
So, Grails 2.0 was released a few days back and I upgraded my application to it as soon as I came to know of its final release and it rocks.!! Among the many things which are making a lot of noise on grails 2.0, there seems to be a lack of noise over the GUI Database console which grails has provided. Developers can connect to the...
In one of the modules that I was working on , I needed to delete the previous data from a table then load up the data into those tables again and then manipulate code through the 'id's' on those tables. So this is what I was doing ... [groovy] Event.executeUpdate('delete from Event') EventInstance.executeUpdate('delete from...
In one of the project I am working on, the application needs to be deployed on windows server. To take the database backup, I wrote the script which does the following : Takes database dump and copy it to the backup folder. Zip that backup file and rename it to the format "YYYYMMDD_HHMMSS" Removes all the backups older than 30...
The current project I am working on, is going through QA. At the same time development of the new features and bug fixing is on and we couldn't afford to loose the test data. So synchronizing the state of the QA database with the development was becoming a pain. So we decided to use grails liquibase plugin. I found one great article by...
In this post i will try to explain how to dump a mysql database so that it can be migrated with same state.In my project i face this situation every week and thanks to dumpfiles that they save lot of time and make the process whole lot easier. What is a dumpfile ? A dumpfile is a sql script which contains the step by step...