Category: Database
Postgresql | How to save default timestamp in unix format instead of yyyy-dd-mm hh:mm:ss
In Postgresql we can save the default timestamp with now() method: CREATE TABLE test ( id serial NOT NULL, name character varying(255), last_modified_time timestamp without time zone DEFAULT now() ) This will save the date timestamp in this format: If
MySQL | Enable/Disable Auto Commit
How to enable or disable autocommit of changes in MySQL using MySQL workbench? Go to Edit->Preferences->SQL Editor->SQL Execution and check your current settings: Also commit/rollback can be done with the buttons on SQL tab:
AWS | Upgrading mysql version
AWS: Upgrading MySQL version Below are few step to upgrade Mysql version very easily on AWS-RDS: 1. Log on to AWS console. 2. Open AWS RDS from Database section: 3. Click on Instances: 4. Select the Database Instance which you
Taking Database Backup And Moving that backup from one server to another using PHP
While working on two servers, we can take the backup of database on one server using mysqldump command in php. Example : exec(‘mysqldump –host ‘.$dbhost.’ –user ‘.$dbuser.’ –password=’.$dbpass.” “. $dbname.’ > ‘.$dbname.’.sql’); After creating dump of database, user can move
Scaffolding in CakePHP
Scaffolding in CakePHP Application scaffolding in CakePHP is a technique that allows the developer to define and create a basic application that can create, retrieve, update and delete objects. Basically CRUD (create, Read, Update, Delete) data operations are common in
Postgresql | Querying over local and remote database together
You can create a dblink to a remote database in postgresql and query both local and remote together. Steps and an example below: 1. Enable dblink in postgresql CREATE EXTENSION dblink; 2. Create connection with database server SELECT dblink_connect(‘dbname=abc port=1234
Java | Hibernate best practices
1. Always define hashCode() and equals() methods in your Persistent classes. 2. Persistent class method’s equals() and hashCode() must access its fields through getter methods. It is a good practice to use accessor methods instead of direct instance variable access.
AWS Amazon EC2 – Install php5.6 in Amazon linux
In Amazon Linux, it is not yet packaged with php5.6. When we install PHP by a standrad command: $yum install php* 1. It will install PHP version 5.3 Below are the steps to update PHP version from 5.3 to 5.6
Java Servlets | Converting relative path to absolute for file upload
In the program of uploading files to a server location, instead of using absolute location for saving file to that path, relative path needs to be used. Program was working correctly for absolute path. In the maven project with the