Friday, 30 January 2009

How to recover the Permanently deleted Outlook lMails

Hi All,
Procedure to recover shift deleted [permanently deleted] mails from Microsoft Outlook.

1) First go to Run and type regedit
3) Right click options and add new DWORD VALUE (data type is REG_DWORD) and then right click and rename to DumpsterAlwaysOn. It is case sensitive.
4) Then rights click and modify and make the value 1 to turn the Recover Deleted Items menu choice on for all folders or enter 0 to turn it off.
5) Then go to Outlook , choose "Recover deleted items" option from the Tools Menu to get back your "permanently deleted" mails!

Note : This procedure can recover mails which were deleted by pressing shift+del in the past 7 days

Sunday, 25 January 2009

How to disable auto-start applications on windows startup?

Hi friends,
It may be frustrating, if it takes time to start up your computer. The reason behind is that many applications or programs loads automatically when the computer starts. I obviously don’t like this applications because it delays the startup of my computer. So i disable most of the auto-start applications except the anti-virus application.
So by using this tip, you can minimize the startup time of windows XP and Vista. You can disable some Windows optional applications which you rarely use like windows messenger, yahoo messenger, Quick time, Sound Man and many other auto-start up programs that run automatically when you start your computer.
Follow the given steps to disable the windows auto-startup applications:
To use this features, you will need to be logged into your computer with administrative rights.
Click start button and type msconfig in Run option then hit Enter for next.
The pictures are taken from Windows XP
msconfig, auto-startup, windows XP statrp-up, windows XP msconfig

A small System Configuration Utility dialog box will appear with many options like General, System.ini, Win.ini, Boot.ini, Services and Startup.
Now Select Startup tab and uncheck the applications that you want to disable from windows startup.

startup, auto-startup, windows start-up, windows XP startup, msconfig, windows XP msconfig

Now click on Apply button to implement the changes then click on OK button to end the configuration process.
Again close the all programs and restart your computer after any changes to go into effect.

Saturday, 10 January 2009

Connect to PostgreSQL with JDBC driver

Here is an example to show you how to connect to PostgreSQL database with JDBC driver.

1. Download PostgreSQL JDBC Driver

Get a PostgreSQL JDBC driver at this URL :


2. Java JDBC connection example

Code snippets to use JDBC to connect a PostgreSQL database

   1: Class.forName("org.postgresql.Driver");
   2: Connection connection = null;
   3: connection = DriverManager.getConnection(
   4:    "jdbc:postgresql://hostname:port/dbname","username", "password");
   5: connection.close();

See a complete example below :
File :

   1: import java.sql.DriverManager;
   2: import java.sql.Connection;
   3: import java.sql.SQLException;
   5: public class JDBCExample {
   7:     public static void main(String[] argv) {
   9:         System.out.println("-------- PostgreSQL "
  10:                 + "JDBC Connection Testing ------------");
  12:         try {
  14:             Class.forName("org.postgresql.Driver");
  16:         } catch (ClassNotFoundException e) {
  18:             System.out.println("Where is your PostgreSQL JDBC Driver? "
  19:                     + "Include in your library path!");
  20:             e.printStackTrace();
  21:             return;
  23:         }
  25:         System.out.println("PostgreSQL JDBC Driver Registered!");
  27:         Connection connection = null;
  29:         try {
  31:             connection = DriverManager.getConnection(
  32:                     "jdbc:postgresql://", "mkyong",
  33:                     "123456");
  35:         } catch (SQLException e) {
  37:             System.out.println("Connection Failed! Check output console");
  38:             e.printStackTrace();
  39:             return;
  41:         }
  43:         if (connection != null) {
  44:             System.out.println("You made it, take control your database now!");
  45:         } else {
  46:             System.out.println("Failed to make connection!");
  47:         }
  48:     }
  50: }

3. Run it

Assume JDBCExample is store in c:\test folder, together with PostgreSQL JDBC driver, then run it :

   1: C:\test>java -cp c:\test\postgresql-8.3-603.jdbc4.jar;c:\test JDBCExample
   2: -------- MySQL JDBC Connection Testing ------------
   3: PostgreSQL JDBC Driver Registered!
   4: You made it, take control your database now!