Sunday, 26 April 2015

GUI for Postgres - pgadmin

Pgadmin is GUI tool for postgresql

To install it in ubuntu 14.04:

sudo apt-get install postgresql postgresql-contrib pgadmin

Installation of Postgres in ubuntu 14.04

sudo apt-get install postgresql postgresql-contrib
sudo -i -u postgres//authenticate as postgres user
sudo -u user_name psql db_name//or u can use this to login directly
psql
createdb test//create db with name as test
\dt //to know tables in db
alter user user_name with password 'new_password';//chage user name delete psql history after query

Tuesday, 21 April 2015

Automatic Scheduler of Jobs in Java

When we need something to do as automatically i.e, scheduled action of program, we usually think of jar's which could do our work.

But in java we have build-in classes know as Process, Runtime and Schedular
ExecutorService.

-> java.lang.Process.
-> java.lang.Runtime.
-> java.util.concurrent.

But we have some jar for doing such jobs:

-> cron4j
-> Quartz