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 / General / March 2007

Tip: Looking for answers? Try searching our database.

ResultSet and getArray()

Thread view: 
Mariano - 22 Mar 2007 22:22 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
Mariano - 23 Mar 2007 18:03 GMT
> Then I have a result set named rs. I need that one column of ResultSet
> rs will be in an array.
[quoted text clipped - 45 lines]
> 110)
> B

no one can help me??
Tom Hawtin - 23 Mar 2007 19:34 GMT
>>         ResultSet rs=mdbc.inviaQuery("select * from ... where ...");

>> Exception in thread "AWT-EventQueue-0"
>> java.lang.UnsupportedOperationException
>>         at
>> sun.jdbc.odbc.JdbcOdbcResultSet.getArray(JdbcOdbcResultSet.java:4425)

> no one can help me??

You've clearly got something to compile. However it's not what you have
posted. It's difficult for anyone to help you without even seeing your code.

However, it looks as if you are using a JDBC feature that is either not
supported by the JDBC-ODBC bridge or by your ODBC driver, or the bridge
and driver support isn't compatible. A good place to start would be
normalising your schema - find a *good* book on SQL.

Tom Hawtin
Mariano - 23 Mar 2007 22:35 GMT
> >>         ResultSet rs=mdbc.inviaQuery("select * from ... where ...");
> >> Exception in thread "AWT-EventQueue-0"
[quoted text clipped - 12 lines]
>
> Tom Hawtin

DB is already normalized and I don't think i've wrong something on it.
The real problem is in file java, infact if I comment the line
rs.getArray("DB_COLUMN_NAME_2"); there's no errore and application
works fine.
Tom Hawtin - 23 Mar 2007 23:12 GMT
> DB is already normalized and I don't think i've wrong something on it.

If it was normalised, it wouldn't have an array in it.

> The real problem is in file java, infact if I comment the line
> rs.getArray("DB_COLUMN_NAME_2"); there's no errore and application
> works fine.

That would make some kind of sense if that line didn't have any kind of
interaction with anything non-Java. That clearly is not the case.

Your bridge/driver/database combination does not appear to support the
operation.

Tom Hawtin
Arne Vajhøj - 25 Mar 2007 03:10 GMT
> DB is already normalized and I don't think i've wrong something on it.
> The real problem is in file java, infact if I comment the line
> rs.getArray("DB_COLUMN_NAME_2"); there's no errore and application
> works fine.

Since you are not using the result from thet call, then why
not keep it outcommented ?

And what data type is DB_COLUMN_NAME_2 since you expect
that call to suceed ?
Arne
Andrew Thompson - 25 Mar 2007 04:05 GMT
> >>         ResultSet rs=mdbc.inviaQuery("select * from ... where ...");
...
> You've clearly got something to compile. However it's not what you have
> posted. ..

Deja vu!  I said much the same thing to this
time-waster on the original post, two days ago
on another group!
<http://groups.google.com/group/comp.lang.java.gui/msg/
b9f5e09c1809f8c9>

To the OP, please ..
- refrain from reposting
- pay attention to the answers you get

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



©2009 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.