Transaction in JDBC

Java JDBC is a very simple and basic library to access to database data, but it is quite common and easy to setup that is why it is kind of popular. However, it has various shortages such as Object-relational mapping (ORM) and Transaction Management. The latter though can be done … Continue Reading →


Database trigger in PostgreSQL

Triggers in DB provides a facility to set triggers on certain tables for performing events (insert, delete, update) in another table. For instance, I want if any entry added to table A, consequentially a new row will be added to table B with some information that comes from table A. … Continue Reading →


In-memory databases

Sometimes in programming need to hold many objects and classes into memory, however, this will cause shortage of heap memory or memory leakage eventually. In order to avoid this bad practise and also not using hard disk to save the data due to its low access speed, you can use … Continue Reading →


Testing Postgres connection with PHP in Ubuntu

PHP is very powerful programming language to write different web application and that is the one of the most important reason I choose to learn it alongside with Python. However, database connection is getting troublesome in PHP specially for new programmers like me even though PHP is quite straightforward and … Continue Reading →


Database design PKID vs GUID

This is an old school debate, actually some people believe GUID is better some have opposite idea. However, each has its own pros and cons which I have listed as much as I could, PKID advantages Easy to remember Incremental and therefore query speed is faster Causes less fragmentation in … Continue Reading →


Basic postgresql commands

PostgreSQL (AKA postgres) is the one of the well-known relational database. It is pretty capable of doing everything such as storing JSON object, DB replication and so on. Beside that it is also open source software. In this post I demonstrate some basic commands of  postgresql for beginners. The first … Continue Reading →


PostgreSQL database replication

In PostgreSQL 9.1 and later database replication feature is provided built in. This feature allows you to have high up time and very low risk of data lose. It is also useful for data mirroring and have high usage for load balancing (For example, very useful in designing banking system). … Continue Reading →


Concat two strings in postgreSQL and MySQL

Recently, I have faced with the situation that I had to update one column value with the combination of two strings (one is another column string and the other one is a single word) for entire table. One way is to update each row manually but what if there are … Continue Reading →


How to connect to remote Postgresql in Java

In the previous post I explained about connecting to remote Postgresql database with SSH command in Linux. This post is dedicated to do make remote connection with do some programming in Java which is quite simple. In order to connect to Postgresql in Java despite the fact of connection type … Continue Reading →


Some Basic SQL Queries

Today I was looking for a specific paper out of the huge bulk of my notes and I have found notes about SQL paper which I wrote them when I was in level one. Therefore, I organized the notes and prepare a short review of basic SQL queries here. I … Continue Reading →


MySQL basic commands

MySQL database is tightly coupled with Linux and in many extends it cannot be separated from Linux in my point of view. In this post I want to describe about some basic commands of MySQL. Note that MySQL also has GUI in Linux but I prefer to work in command … Continue Reading →