Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2007

Tip: Looking for answers? Try searching our database.

ResultSet and getArray() - Error on AWT

Thread view: 
Mariano - 22 Mar 2007 22:58 GMT
Then I have a result set named rs. I need that one column of ResultSet
rs will be in an array.
I've read about method getArray(), so i've thinked that my code will
be something like that:
================================
private void formWindowOpened(java.awt.event.WindowEvent evt)
{
       ResultSet rs=mdbc.inviaQuery("select * from ... where ...");

       try {
           rs.next();
               txtNome.setText(rs.getString("DB_COLUMN_NAME_1"));
               rs.getArray("DB_COLUMN_NAME_2");
      } catch {
           // EXCEPTION
      }
================================
Alas there's something that's go wrong and I get this error
(paziente.java552 is the line containing
rs.getArray("DB_COLUMN_NAME_2");) where's my mistake:

Exception in thread "AWT-EventQueue-0"
java.lang.UnsupportedOperationException
       at
sun.jdbc.odbc.JdbcOdbcResultSet.getArray(JdbcOdbcResultSet.java:4425)
       at cc.Paziente.formWindowOpened(Paziente.java:552)
       at cc.Paziente.access$000(Paziente.java:15)
       at cc.Paziente$1.windowOpened(Paziente.java:94)
       at java.awt.Window.processWindowEvent(Window.java:1187)
       at javax.swing.JFrame.processWindowEvent(JFrame.java:266)
       at java.awt.Window.processEvent(Window.java:1148)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Window.dispatchEventImpl(Window.java:1778)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:
242)
       at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
163)
       at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
       at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:
110)
B
Andrew Thompson - 23 Mar 2007 06:10 GMT
..
> ..so i've thinked that my code will
> be something like that:

Please do not waste your time, and our bandwidth,
with code that is 'something like' the code you
are using (and it seems to me, that code you
posted is not even an accurate description of
the current code being used).

For these case, I recommend an SSCCE.
<http://www.physci.org/codes/sscce.html>

Andrew T.
Mariano - 23 Mar 2007 18:23 GMT
> ..
>
[quoted text clipped - 11 lines]
>
> Andrew T.

words... "my code will be something like that" that's why, i don't
know how to complete that code.
I have to assign rs.getArray("..."); content to an array, but it's not
so easy, at least for me.
Andrew Thompson - 24 Mar 2007 08:44 GMT
..
> > For these case, I recommend an SSCCE.
> > <http://www.physci.org/codes/sscce.html>
...
> words... "my code will be something like that" that's why, i don't
> know how to complete that code.

I am not that concerned with how you
think the code *might* be completed.
That is not the point.

What is more useful is an answer to the
question 'what is the *exact* code you are
currently using - that makes this error'?

That code you posted, *cannot* be the
code you are using, since it would not
even compile, let alone run.

But 'the complete code' would not be very
welcome here either (I note that your
stacktrace implies it has 500+ lines of
code).  Instead, an SSCCE (did you read
the article?) would be short, descriptive,
and help us to help you.

> ..but it's not so easy, at least for me.

That's why we get 'the big bucks'.  If writing
software was easy, they would get monkeys to
do it.   ;-)

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.