Re: Java Gui for Postgress - Mailing list pgsql-general

From Craig Ringer
Subject Re: Java Gui for Postgress
Date
Msg-id 4A1B6E3F.8070405@postnewspapers.com.au
Whole thread Raw
In response to Java Gui for Postgress  (queries <michaelkni@hotmail.com>)
Responses Re: Java Gui for Postgress
List pgsql-general
queries wrote:
> Hi Everyone,
>
> I need to build a simple gui front end with jdbc access to my Postgres
> database. I have the front end ready and I have some code which retrieves
> records from my database, but for some reason I keep on getting errors
> (lately just freezes without errors) when I apply that same code to the
> buttons on my gui. It's definitely me doing something stupid because I have
> 0% knowledge in java. Can anyone help?

This looks a lot like a uni assignment:

> Class.forName("org.postgresql.Driver"); // Remeber Last Lecture?

For your "freeze" problems: run it under the debugger in netbeans. When
it "freezes", pause execution and look at the event dispatch thread
(EDT); see what it's doing and what it's waiting for.

You really haven't provided enough information, or complete enough code,
to give you more of an answer. What GUI? I don't see anything GUI
related in the code you posted.

I'm not sure this is relevant to you, but as general advice: Make sure
you never do anything affecting the GUI from any thread except the event
dispatch thread. Ever. Use deferred tasks (ref: SwingTask, Runnable,
etc) if possible, or use typical thread synchronization mechanisms.

--
Craig Ringer

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: do postgresql this job for me ? (firebird user)
Next
From: iSTRONG
Date:
Subject: Re: PGS Tuning Wizard destroys my login