This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

SQL Statements vom Client auswerten

Allgemeine Fragen zur Entwicklung von und mit JVx.

SQL Statements vom Client auswerten

Postby Support@SIB » Fri Mar 05, 2010 12:25 pm

Am Client wird ein SQL Statement wie z.B

Code: Select all
select nachname, vorname from person order by nachname

eingegeben.

Das Ergebnis des Statements soll in einer Tabelle angezeigt werden. Im Idealfall sollte die Person
auch verändert werden können...
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm

Re: SQL Statements vom Client auswerten

Postby Development@SIB » Fri Mar 05, 2010 1:05 pm

Auszug des Client Codes:

Code: Select all
UITextArea taStmt;
UITable tblResult;

private void init()
{
    taStmt = new UITextArea();
    UIButton butExec = new UIButton("Execute");
    butExec.eventAction().addListener(this, "doExecute");

    tblResult = new UITable();

   //Layouting
}

public void doExecute() throws Throwable
{
    String sRemoteName = getConnection().callAction("execute", taStmt.getText());

    //or use a business object to encapsulate sql handling
    //sRemoteName = getConnection().call("dbmanager", "execute", taStmt.getText());

    RemoteDataBook rdb = new RemoteDataBook();
    rdb.setDataSource(rds);
    rdb.setName(sRemoteName);
    rdb.open();
   
    tblResult.setDataBook(rdb);
}

Auszug des Server Codes:

Code: Select all
public String execute(String pStatement) throws Exception
{
    DBStorage dbs = new DBStorage();
    dbs.setDBAccess(getDBAccess());
    dbs.setFromClause("(" + pStatement + ")");
    dbs.open();

    String sCalls = "call" + (calls++);

    put(sCalls, dbs);

    return sCalls;
}


Hinweis

Die obige Implementierung berücksichtigt nur select/query Statements. Wenn Insert/Updates/Delete/Function,Procedure calls durchgeführt werden sollen, dann wäre die Implementierung eines eigenen Objektes vom Typ IStorage die richtige Wahl.
Optional könnte Server seitig in einem speziellen Business Objekt entschieden werden wie mit dem Statement umgegangen wird, ggf. direkt ein PreparedStatement ausführen.

Am Client könnte auch ein MemDataBook anstatt des RemoteDataBook von Vorteil sein.
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Re: SQL Statements vom Client auswerten

Postby Development@SIB » Fri Mar 05, 2010 1:09 pm

Um die Daten verändern zu können wäre es nötig für die DBStorage eine geeignete writeback Table zu definieren. Dies könnte einerseits durch einen eigenen Parameter oder Statement parsing durchgeführt werden.
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Re: SQL Statements vom Client auswerten

Postby Paul » Wed Jul 27, 2011 11:42 am

Ich habe versucht der Beispiel-Implementierung zu folgen,
aber bei mir funktioniert das überhaupt nicht.
Nach meinem Verständnis, kann an die Methode "setFromClause" eben auch nur ein Tabellenname übergeben werden und nicht ein vollständiges Select-Statement.
Kann es sein, dass das mit der aktuellen Version von JVx (1.0 beta-2) so nicht mehr möglich ist?!
Paul
 
Posts: 5
Joined: Mon Jul 25, 2011 11:03 am

Re: SQL Statements vom Client auswerten

Postby Support@SIB » Wed Jul 27, 2011 11:55 am

Was genau funktioniert nicht?
Gibt es eine Exception oder wird das Statement nicht ausgeführt?

Um herauszufinden welches Statement abgesetzt wird, kann das Logging aktiviert werden, siehe Logging.
Der Eintrag com.sibvisions.rad.persist.level = ALL sollte ausreichen.

In JVx 1.0 beta-2 haben sich die Möglichkeiten nicht verändert!
Ich möchte jedoch darauf hinweisen, daß diese Lösung nicht der empfohlene Weg ist, da sie die Logik und Datenbankinformationen auf den Client verschieben. Wenn das jedoch in Ihrem Sinne ist, dürfte es dennoch keine Probleme geben.
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm

Re: SQL Statements vom Client auswerten

Postby Support@SIB » Wed Jul 27, 2011 12:00 pm

Der empfohlene Weg um Daten aus der DB auf den Client zu übertragen wäre wie in diesem Beispiel.

Die Methode "setFromClause" kann natürlich auch "nur" den Tabellennamen enthalten, anstelle von kompletten Statements.
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm

Re: SQL Statements vom Client auswerten

Postby Paul » Wed Jul 27, 2011 12:41 pm

Folgende Exceptions treten auf:

Code: Select all
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Every derived table must have its own alias
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
   at com.mysql.jdbc.Util.getInstance(Util.java:381)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1051)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3563)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3495)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2693)
   at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2102)
   at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2261)
   at com.sibvisions.rad.persist.jdbc.DBAccess.getColumnMetaData(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.getMetaData(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.openInternal(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.open(Unknown Source)
   at apps.firstapp.frames.SQLSelect.execute(SQLSelect.java:42)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.sibvisions.util.Reflective.call(Unknown Source)
   at com.sibvisions.util.Reflective.call(Unknown Source)
   at com.sibvisions.rad.server.GenericBean.invoke(Unknown Source)
   at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
   at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.Server.execute(Unknown Source)
   at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
   at javax.rad.remote.AbstractConnection.callAction(Unknown Source)
   at apps.firstapp.frames.SQLSelectFrame.initializeModel(SQLSelectFrame.java:95)
   at apps.firstapp.frames.SQLSelectFrame.<init>(SQLSelectFrame.java:75)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at apps.firstapp.FirstApplication.openFrame(FirstApplication.java:465)
   at apps.firstapp.FirstApplication.doOpenFrame(FirstApplication.java:403)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
   at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.Component.processMouseEvent(Component.java:6289)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6054)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4652)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
   at java.awt.EventQueue.access$000(EventQueue.java:85)
   at java.awt.EventQueue$1.run(EventQueue.java:603)
   at java.awt.EventQueue$1.run(EventQueue.java:601)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:617)
   at java.awt.EventQueue$2.run(EventQueue.java:615)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


Code: Select all
javax.rad.persist.DataSourceException: Meta data couldn't load from database! - SELECT * FROM (SELECT id FROM t_tank) WHERE  1=2
   at com.sibvisions.rad.persist.jdbc.DBAccess.getColumnMetaData(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.getMetaData(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.openInternal(Unknown Source)
   at com.sibvisions.rad.persist.jdbc.DBStorage.open(Unknown Source)
   at apps.firstapp.frames.SQLSelect.execute(SQLSelect.java:42)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at com.sibvisions.util.Reflective.call(Unknown Source)
   at com.sibvisions.util.Reflective.call(Unknown Source)
   at com.sibvisions.rad.server.GenericBean.invoke(Unknown Source)
   at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
   at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.Server.execute(Unknown Source)
   at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
   at javax.rad.remote.AbstractConnection.callAction(Unknown Source)
   at apps.firstapp.frames.SQLSelectFrame.initializeModel(SQLSelectFrame.java:95)
   at apps.firstapp.frames.SQLSelectFrame.<init>(SQLSelectFrame.java:75)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at apps.firstapp.FirstApplication.openFrame(FirstApplication.java:465)
   at apps.firstapp.FirstApplication.doOpenFrame(FirstApplication.java:403)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
   at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.Component.processMouseEvent(Component.java:6289)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6054)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4652)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
   at java.awt.EventQueue.access$000(EventQueue.java:85)
   at java.awt.EventQueue$1.run(EventQueue.java:603)
   at java.awt.EventQueue$1.run(EventQueue.java:601)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:617)
   at java.awt.EventQueue$2.run(EventQueue.java:615)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


Code: Select all
java.lang.RuntimeException: javax.rad.persist.DataSourceException: Meta data couldn't load from database! - SELECT * FROM (SELECT id FROM t_tank) WHERE  1=2
   at com.sibvisions.rad.server.GenericBean.invoke(Unknown Source)
   at com.sibvisions.rad.server.DefaultObjectProvider.invoke(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeWithSessionContext(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.AbstractSession.execute(Unknown Source)
   at com.sibvisions.rad.server.Server.executeIntern(Unknown Source)
   at com.sibvisions.rad.server.Server.execute(Unknown Source)
   at com.sibvisions.rad.server.DirectServerConnection.call(Unknown Source)
   at javax.rad.remote.AbstractConnection.callAction(Unknown Source)
   at apps.firstapp.frames.SQLSelectFrame.initializeModel(SQLSelectFrame.java:95)
   at apps.firstapp.frames.SQLSelectFrame.<init>(SQLSelectFrame.java:75)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at apps.firstapp.FirstApplication.openFrame(FirstApplication.java:465)
   at apps.firstapp.FirstApplication.doOpenFrame(FirstApplication.java:403)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at javax.rad.util.EventHandler$ListenerHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.EventHandler.dispatchEvent(Unknown Source)
   at javax.rad.util.RuntimeEventHandler.dispatchEvent(Unknown Source)
   at com.sibvisions.rad.ui.swing.impl.component.SwingAbstractButton.actionPerformed(Unknown Source)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
   at java.awt.Component.processMouseEvent(Component.java:6289)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6054)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4652)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4482)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
   at java.awt.EventQueue.access$000(EventQueue.java:85)
   at java.awt.EventQueue$1.run(EventQueue.java:603)
   at java.awt.EventQueue$1.run(EventQueue.java:601)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:617)
   at java.awt.EventQueue$2.run(EventQueue.java:615)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)



Aus dem übergebenen Statement:
Code: Select all
SELECT id FROM t_tank


wird also folgendes Statement generiert:
Code: Select all
SELECT * FROM (SELECT id FROM t_tank) WHERE  1=2


Das kann ja nicht klappen ;)
Liegt das ganze vielleicht daran, dass ich eine MySQL-DB anspreche?!
Bisher kam JVx damit allerdings ganz gut zurecht.
Paul
 
Posts: 5
Joined: Mon Jul 25, 2011 11:03 am

Re: SQL Statements vom Client auswerten

Postby Support@SIB » Wed Jul 27, 2011 12:52 pm

Die erste Exception enthält einen Lösungshinweis:

Code: Select all
SELECT * FROM (SELECT id FROM t_tank) t WHERE  1=2

(Der Alias sollte das Problem mit den MetaDaten lösen)
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm

Re: SQL Statements vom Client auswerten

Postby Paul » Wed Jul 27, 2011 1:26 pm

Vielen Dank!
Das Hinzufügen eines Alias löst tatsächlich das Problem.
Ich bin fälschlicherweise davon ausgegangen,
dass es sich um ein grundsätzliches Problem von JVx handeln würde.
Beim nächsten mal werde ich mir die Exceptions genauer anschauen,
bevor ich Sie belästige - Versprochen!
Paul
 
Posts: 5
Joined: Mon Jul 25, 2011 11:03 am

Re: SQL Statements vom Client auswerten

Postby Support@SIB » Wed Jul 27, 2011 1:35 pm

Überhaupt kein Problem. Dieser Thread hilft sicher auch anderen Entwicklern mit dem selben Problem. Wenn niemand über seine Probleme spricht beginnt die Suche für jeden wieder vorn vorne ;-)
User avatar
Support@SIB
 
Posts: 349
Joined: Mon Sep 28, 2009 1:56 pm


Return to Development (DE)