Update ResultSet Hi everyone,
I have a query including an inner join, which I execute to obtain a
ResultSet, but when I execute the following piece of code I get an error
message saying that it could not update the table because it could not
find the primary key for a table.
rs.first();
rs.updateString("gene", "TestGen");
rs.updateRow();
Here is my query:
SELECT gene_entropy.gene, gene_entropy.entropy, gene_entropy.iteration,
snp_entropy.snp_id
FROM clustering.gene_entropy INNER JOIN clustering.snp_entropy
USING(gene) limit 5;
And here is the stacktrace:
org.postgresql.util.PSQLException: Für die Tebelle
(clustering.gene_entropy konnte kein Primärschlüssel gefunden werden.
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.isUpda teable(AbstractJdbc2ResultSet.java:1547)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkU pdateable(AbstractJdbc2ResultSet.java:2550)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.update Value(AbstractJdbc2ResultSet.java:2796)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.update String(AbstractJdbc2ResultSet.java:1309)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.update String(AbstractJdbc2ResultSet.java:1394)
at
myapp.ui.event.DBTableFrameListener.actionPerforme d(DBTableFrameListener.java:406)
at
javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:387)
at
javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:236)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEven tMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.jav a:6038)
at
javax.swing.JComponent.processMouseEvent(JComponen t.java:3260)
at java.awt.Component.processEvent(Component.java:580 3)
at java.awt.Container.processEvent(Container.java:205 8)
at java.awt.Component.dispatchEventImpl(Component.jav a:4410)
at java.awt.Container.dispatchEventImpl(Container.jav a:2116)
at java.awt.Component.dispatchEvent(Component.java:42 40)
at
java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4322)
at
java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3986)
at
java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3916)
at java.awt.Container.dispatchEventImpl(Container.jav a:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429 )
at java.awt.Component.dispatchEvent(Component.java:42 40)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 599)
at
java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:173)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:168)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:160)
at
java.awt.EventDispatchThread.run(EventDispatchThre ad.java:121)
I am more than happy and thankful for any advice!
Christian Rengstl M.A.
Klinik und Poliklinik für Innere Medizin II
Kardiologie - Forschung
Universitätsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match |