ResultSet and getArray()

M

Mariano

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
 
M

Mariano

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??
 
T

Tom Hawtin

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
 
M

Mariano

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.
 
T

Tom Hawtin

Mariano said:
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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Mariano said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top