Category: Database
MySQL | Insert multiple records and update if record(s) already exist in a single query
In MySQL, we generally perform insert, update, select and delete operations on records of table. Multiple Insert operation can also be easily performed on table. Take an example of Employees table with fields: Multiple records can be inserted in Employees
MySQL | Upgrade MySQL 5.5 to 5.6 in Ubuntu 14.04
MySql 5.5 is the default version for Ubuntu 14.04 Steps to Upgrade the mysql-server If you have existing database in Mysql 5.5. It should be migrated automatically. Take the backup of existing databases: mysql> mysqldump –lock-all-tables -u root -p -all-databases
MySQL | Find if particular value is selected in multi pick list
In simple pick list we can select only one value but in multi pick list we can select one or more values. Scenario: We had to multi pick list data type field Fields that we wanted to select : 1.
Maintaining record history in database
When you are building a web-based multi/single tenant system or a desktop system which has a database at its backend to maintain records, keeping the history of records proves to be very useful in the long run from information and
How to use SimpleSAMLPhp as a Service Provider for authenticating users?
How to use SimpleSAMLPhp as a Service Provider for authenticating users? Some Basic steps to start using simplesamlphp. 1. Download stable version of SimpleSAMLphp from this link: Click here 2. Go to the directory or your workspace where you want
Ubuntu 14.04 | Installing postgresql 9.4
Follow steps below to install Postgresql 9.4 (instead of 9.3 for which sources are added by default in Ubuntu 14.04): 1. Remove the previous PostgreSQL Version: *Make sure that you firstly backup your databases. $ sudo apt-get –purge remove postgresql-* 2. Add
java.sql.SQLException: Data truncated for column date at row 1
You may face this exception while trying to insert data in a mysql table using hibernate: java.sql.SQLException: Data truncated for column date at row 1 While there can be different reasons of this problem, in our case it was occurring
Java | Execute SQL script using Maven
Whenever there is a change in the database whether we are altering database structure or adding/updating data inside database most of the times we create a script file and run it manually. We can automate this process using Maven. Solution:
MySQL | How to automatically update timestamp field
Sometimes, we need to check when was the data last accessed. In MySQL, we had taken a field last_modified_time as timestamp datatype in a table, which was set to CURRENT_TIMESTAMP by DEFAULT. When a new record was inserted, it automatically