I'm licensed user of the SmartGWT pro.
I'm using SmartGWT Pro v3.0
I use SQLDataSource (basic SQL connector) to connect to the DB2 database.
The client side code to connect to the database looks like this:
The data source file looks like this:
When I'm trying to update or insert the row in this table, I get this error:
Client error looks like this:
I suspect that the problem is that integer field is wrapped to the quotes in the SQL request and thus DB2 treats it as a string.
I tried to use different versions of the DB2 driver:
db2jcc.jar DRIVER=3.64.104
db2jcc4-9.7.2.jar DRIVER=4.9.78
db2jcc4.jar DRIVER=4.14.111
but I got the same error.
When the database table contains only VARCHAR fields - no problems appear.
The same code was tested with MySQL database without any problems.
Does anyone have any idea how to solve it?
Is there any way for me to control the process of SQL request creation when I'm using the SQL Data Source?
Any help is really appreciated.
I'm using SmartGWT Pro v3.0
I use SQLDataSource (basic SQL connector) to connect to the DB2 database.
The client side code to connect to the database looks like this:
Code:
ListGrid listGrid = new ListGrid(); listGrid.setWidth(700); listGrid.setHeight(224); listGrid.setResizeFieldsInRealTime(true); listGrid.setAlign(Alignment.LEFT); listGrid.setAlternateRecordStyles(true); listGrid.setShowFilterEditor(true); listGrid.setCanEdit(true); listGrid.setEditEvent(ListGridEditEvent.CLICK); listGrid.setCanRemoveRecords(true); listGrid.setDataSource(DataSource.get("code")); listGrid.setAutoFetchData(true);
Code:
<DataSource ID="code" tableName="CODE" serverType="sql"> <fields> <field name="ID" title="Id" type="integer" primaryKey="true"/> <field name="NAME" title="Name" type="text" length="255"/> </fields> </DataSource>
Code:
DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=4.9.78
Code:
com.smartgwt.client.core.JsObject$SGWT_WARN: 15:02:01.409:XRP5:WARN:RPCManager:DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC==, DRIVER=4.14.111, response: {operationId: "custom", clientContext: Obj, context: Obj, transactionNum: 2, httpResponseCode: 200, httpResponseText: "//isc_RPCResponseStart-->[{data:"DB2 SQL..."[178], xmlHttpRequest: [object XMLHttpRequest], transport: "xmlHttpRequest", status: -1, clientOnly: undef, httpHeaders: Obj, isStructured: true, callbackArgs: null, results: Obj, data: "DB2 SQL Error: SQLCODE=-401, SQLSTATE=42..."[72], invalidateCache: false, isDSResponse: true, startRow: 0, endRow: 0, totalRows: 0} 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.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:662)
I tried to use different versions of the DB2 driver:
db2jcc.jar DRIVER=3.64.104
db2jcc4-9.7.2.jar DRIVER=4.9.78
db2jcc4.jar DRIVER=4.14.111
but I got the same error.
When the database table contains only VARCHAR fields - no problems appear.
The same code was tested with MySQL database without any problems.
Does anyone have any idea how to solve it?
Is there any way for me to control the process of SQL request creation when I'm using the SQL Data Source?
Any help is really appreciated.
Comment