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

From queries
Subject Re: Java Gui for Postgress
Date
Msg-id 23716813.post@talk.nabble.com
Whole thread Raw
In response to Re: Java Gui for Postgress  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-general
Hi Craig,

Thank you for your reply and for all of the pointers. I didn't include the
Gui code (It would have taken too much space), just the simple query code
that already works in printing out the results I wanted. Basically I just
wanted to find out how to use this code which works, inside of a Gui by
pressing a button and for results to be displayed inside of a text box.
Basically what code to include under
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {? I've played
around with the code, but haven't been able to make it work yet. I'm very
new to java, we've had only two one hour tutorials so far on this in a class
dedicated to relational databases. It will probably be something simple.

Michael


Craig Ringer wrote:
>
> 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
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>

--
View this message in context: http://www.nabble.com/Java-Gui-for-Postgress-tp23704425p23716813.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: how to delete many rows from a huge table?
Next
From: Ramiro Diaz Trepat
Date:
Subject: very large tables