Menu

#143 Edit Data / Hotkeys Ctrl + Enter

Orbada_IDE
open
nobody
5
2014-11-17
2014-11-10
Anonymous
No

Hi,

I have 2 Problems:

1. Hotkeys:

I tested the hotkeys Ctrl + Enter from the "SQL queries"-Tab,
which should execute "select * from TAB" after entering only the TAB-Name.
(name of the table is "VSADRE")
This it what happens in several Databases:

Firebird 2.5 and Oracle 10: all works fine

Microsoft SQL-Server 2005:

I get this error:

com.microsoft.sqlserver.jdbc.SQLServerException: Fehler bei der Anforderung für Prozedur 'VSADRE', da 'VSADRE' ein Tabelle-Objekt ist.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
at pl.mpak.usedb.core.Command.execute(Command.java:143)
at pl.mpak.orbada.universal.gui.SqlQueryPanelView$34.run(SqlQueryPanelView.java:1610)
at pl.mpak.util.task.TaskExecutor.run(TaskExecutor.java:34)

Microsoft SQL-Server 2008:

The same error:

com.microsoft.sqlserver.jdbc.SQLServerException: Fehler bei der Anforderung für 'VSADRE' (Prozedur), weil 'VSADRE' ein Tabelle-Objekt ist.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)
at pl.mpak.usedb.core.Command.execute(Command.java:143)
at pl.mpak.orbada.universal.gui.SqlQueryPanelView$34.run(SqlQueryPanelView.java:1610)
at pl.mpak.util.task.TaskExecutor.run(TaskExecutor.java:34)

Microsoft SQL-Server 2000 (connected with JDBC ODBC Bridge):

I get this error:

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Die Verbindung ist mit Ergebnissen von einem anderen hstmt belegt
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at pl.mpak.usedb.core.Command.execute(Command.java:143)
at pl.mpak.orbada.universal.gui.SqlQueryPanelView$34.run(SqlQueryPanelView.java:1610)
at pl.mpak.util.task.TaskExecutor.run(TaskExecutor.java:34)

2. Edit Data:

I just want to edit the data of a Table-Field. For example changing the content of a numeric
field from 4 to 5 or changing the content of a string-field from "Hello world" to "Hello
universe".
I don't want to use an SQL-UPDATE-Command for this, just want to type directly in the
Content-grid of a table.
As this doesn't work, I found the Edit-Data-Button in the Result-Grid of the "SQL queries"-
Tab. So I used a simple query like "select * from tab" and clicked on the edit-data-button.
The Hint says: "Edit the data table TAB is possible."

This happens with sereral databases:

Firebird 2.5:

After double-clicking on a numeric-field (prikey), the field could not be edited and
I get the error:

java.lang.ArrayIndexOutOfBoundsException: -1
at org.firebirdsql.jdbc.FBResultSetMetaData.getXsqlvar(FBResultSetMetaData.java:662)
at org.firebirdsql.jdbc.FBResultSetMetaData.getColumnType(FBResultSetMetaData.java:389)
at pl.mpak.usedb.core.Query.classByField(Query.java:987)
at pl.mpak.usedb.gui.swing.QueryTableModel.getColumnClass(QueryTableModel.java:142)
at javax.swing.JTable.getColumnClass(Unknown Source)
at javax.swing.JTable.getCellEditor(Unknown Source)
at javax.swing.JTable.editCellAt(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI$Handler.adjustSelection(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

After double-clicking on a string-field, I could edit the field and I could change
the content. After changing I pressed ENTER and after that I clicked on the Commit-Button
at the top (green arrow) to commit the changes in the database. No error messages.
But after executing the query again, my changes are not made. The old data is shown again.

Microsoft SQL-Server 2005, Microsoft SQL-Server 2008, Oracle 10:

The content of all fields could be changed. After commit all is changed in the database.
All works fine!

Such a data-edit-button directly in the content-grid of a selected table would be great! :-)

So that's all for now...

My ORBADA-Version is: 1.2.3 (346)

Greetings...

Don

Discussion

  • Andrzej Kałuża

    Hi Don :)

    how Orbada works and what it can:

    1. SQL tab is a universal tab for all databases. Universalism, unfortunately have consequences - not everything in this tab works for all databases - especially that the standard jdbc not all producers are respected
    2. for now - supported databases by Orbada - Oracle, Firebird, PostgreSQL, sqlite, hsqldb, mysql - not MS SQL Server - I don't like this server ;-)

    but

    java.lang.ArrayIndexOutOfBoundsException: -1
    is a bug - I'll try to reproduce it at home and fix

    You are the second person who suggested me to add the ability to edit data from content tab :-)

    I change the mechanism of editing data from sql tab to "updatable resultset" - now is universal. Orbada search primary key by JDBC driver (not directly from database system views) and generate UPDATE/INSERT/DELETE commands

    Thank you for reporting problems,
    Andrzej

     

    Last edit: Andrzej Kałuża 2014-11-14
  • Anonymous

    Anonymous - 2014-11-17

    Hi Andrzej,

    thanks for your response and the explanations.
    I think it's definitely not easy to handle the behaviour of all
    databases in a universal way. So there will always be some
    restrictions.
    And therefore there are less tools which dare to this "adventure"...
    And orbada does a great job here. :-)

    So I'm looking forward to the next version...

    Greetings,

    Don

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB