Showing posts from November, 2010

Connecting to postgres database in java code

To connect you java program with postgres driver, add the postgres library jar (postgresql-jdbc3-8.2.jar or any current jar file) file in the libraries. Then the following code can be modified for your particular database and table.

package javaapplication1;
import java.sql.*;
 * @author shankar
public class Main {

     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
          System.out.println("-------- PostgreSQL JDBC Connection Testing ------------");

      try {
            Connection connection = null;

             connection = DriverManager.getConnection("jdbc:postgresql://","postgres", "postgres");
       if (connection != null)

                  Statement s=connection.createStatement();
                  String query="select ad_a…

Performance Enhancement in Ubuntu 10.04

I am using ubuntu for an while now and over the last few months and I find that the performance of my system has been drastically reduced. I know its more because of improper system management than hardware ineffectiveness (mine is a 2gb ram with 160gb hard disk). If it were windows it would have been simple..:) Run disk defragment, %prefetch%, %temp%, temp in cmd and delete all temporary files. But ubuntu is more fun, because you don't employ some tool to do the job that you should bend yourself and do..:) So here is the list of things that i did in order to increase the performance of my Ubuntu System.

1.Prelink:               Go to Synaptic Package Manager and search for 'prelink' and you will find  a single app. install that and then come over to terminal and edit the following file, /etc/default/prelink
i.e give
gksu gedit /etc/default/prelink
and in the file that opens up, change the PRELINKING=unknown to PRELINKING=yes.
This will help in prelinking applications, ena…

Openbravo Environment Setup in Eclipse

I have been using Openbravo for about an year now and what I noticed is that its a big jungle to get into first. You have to learn all about Ubuntu (the preferred platform), then setting up the stack viz, Java, Postgres, PgAdmin(GUI of postgres), Tomcat, Ant, Openbravo, Pentaho(BI tool), etc etc...A good play ground to dig and play, but you can be rest assured your suits wont go unscathed more often than not. This is where you need a good dig tool and IDE's are just for that task.  Though my personal favorite IDE is Netbeans, Eclipse is the preferred environment for Openbravo, so I decided to go through that route..:)

I went through  a lot of hardships, but nevertheless the result was satisfying and i wanted to bring you that. There is a Eclipse installation Manual (, but I can assure you that with that link, its bound to take you at least 2 days to…

Openbravo works with Postgres 9.0 !!!

I was quite fascinated with the hype around postgres 9.0 that competes itself with Oracle and other proprietary servers. So i decided to test it out myself. I did not have the big heart to install it in my ubuntu that already runs 8.4, so installed it in my windows. I usually don't use windows for Openbravo development. Reason: I was conditioned ubuntu is the preferred environment for Openbravo. But then seeing Postgres 9.0 and pgadmin in fullswing, I could not  resist myself from installing the development stack for Openbravo in ubuntu. It was child's play for me in ubuntu as I had installed at least 10-20 copies of it already. But in windows7 its a different story all together. For the first time i thought ubuntu is easier than windows to configure. After 2 days of struggle, all i could have was Openbravo deployed in server in false mode..:). I knew it was the issue with space allocation, but not sure where to resolve. Then I read in some blog that when we run the Tomcatw e…