> public static void main(String[] args) {
>
> PostgreSQLJDBC app = new PostgreSQLJDBC();
>
> int idx = 1;
>
> System.out.println("About to try connecting to postreSQL database ...");
>
> Connection db_con = app.connect();
>
> if (db_con == null) {
>
> System.out.println("Unable to connect to the database ... check the
> logs for the exception message");
>
> }
>
> else {
>
> System.out.println("Successfully connected to the database!! Try
> running a query");
>
> }
>
> System.out.println("Inside main - about to enter a long loop");
>
> while (true) {
>
> System.out.printf("Looping a set number of times ... Loop Iteration:
> %d%n", idx);
>
> idx++;
>
> try {
>
> TimeUnit.SECONDS.sleep(5);
>
> }
>
> catch (Exception e) {
>
> System.out.println(e.getMessage());
>
> }
>
> }
>
> }
>
> }
>
I think this while loop is not going to exit.
Maybe while (idx < 1000)