ResultSet and getArray()  
Author Message
Mariano





PostPosted: 2007-3-23 5:23:00 Top

java-programmer, ResultSet and getArray() 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





PostPosted: 2007-3-24 1:03:00 Top

java-programmer >> ResultSet and getArray() On 22 Mar, 22:22, "Mariano" <email***@***.com> wrote:
> 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

no one can help me??


 
Tom Hawtin





PostPosted: 2007-3-24 2:34:00 Top

java-programmer >> ResultSet and getArray() Mariano wrote:
> On 22 Mar, 22:22, "Mariano" <email***@***.com> wrote:
>> 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





PostPosted: 2007-3-24 5:35:00 Top

java-programmer >> ResultSet and getArray() On 23 Mar, 19:34, Tom Hawtin <email***@***.com> wrote:
> Mariano wrote:
> > On 22 Mar, 22:22, "Mariano" <email***@***.com> wrote:
> >> 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

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





PostPosted: 2007-3-24 6:12:00 Top

java-programmer >> ResultSet and getArray() Mariano wrote:
>
> 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鴍





PostPosted: 2007-3-25 10:10:00 Top

java-programmer >> ResultSet and getArray() Mariano wrote:
> 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





PostPosted: 2007-3-25 11:05:00 Top

java-programmer >> ResultSet and getArray() On Mar 24, 4:34 am, Tom Hawtin <email***@***.com> wrote:
> Mariano wrote:
> > On 22 Mar, 22:22, "Mariano" <email***@***.com> wrote:
> >> 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.