Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Datasource cannot load data from database

$
0
0
Hello there,

I am using a licence copy of SmartGWT Power 3 and testing on Firefox browser version 26.

I am trying to load a listgrid with data from many tables(they have foreign key relationship). When I run my application I get this
Response in my Developer Console

Code:

{
    affectedRows:0,
    data:"The multi-part identifier \"CusNeiGroupDS.province\" could not be bound.",
    invalidateCache:false,
    isDSResponse:true,
    queueStatus:-1,
    status:-1
}

and this is my DSRequest

Code:

{
    dataSource:"CusNeiGroupDS",
    operationType:"fetch",
    componentId:"isc_ListGrid_0",
    data:{
    },
    startRow:0,
    endRow:75,
    textMatchStyle:"substring",
    resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: CusNeiGroupDS, created by: isc_ListGrid_0)],
    callback:{
        caller:[ResultSet ID:isc_ResultSet_0 (dataSource: CusNeiGroupDS, created by: isc_ListGrid_0)],
        methodName:"fetchRemoteDataReply"
    },
    willHandleError:true,
    showPrompt:true,
    prompt:"Finding Records that match your criteria...",
    oldValues:{
    },
    requestId:"CusNeiGroupDS$6270",
    internalClientContext:{
        requestIndex:1
    },
    fallbackToEval:false,
    bypassCache:true
}

This is my DS.xml file

Code:


<DataSource ID="CusNeiGroupDS" serverType="sql">
        <fields>
                <field name="province" title="province" primaryKey="true" type="text" />
                <field name="capital" title="capital"  type="text" />
                <field name="code" title="code"  type="text" />
                <field name="telcode" title="telcode"  type="text" />
                <field name="taxcode" title="taxcode"  type="text" />
                <field name="county" title="county"  type="text" />
                <field name="district" title="district"  type="text" />
                <field name="city" title="city"  type="text" />
                <field name="zone" title="zone"  type="text" />
                <field name="neighbour" title="neighbour"  type="text" />
                <field name="taxcodecity" title="taxcodecity"  type="text" />
                <field name="fdocode" title="fdocode"  type="text" />
                <field name="countCustomer" title="countCustomer"  type="int" />
        </fields>

        <operationBindings>
                <operationBinding operationType="fetch">
                        <!-- <tableClause>province,county,district,city,zone,neighbourhood,customer</tableClause> -->
                        <selectClause>
                        province.capital,
    province.code,
    province.telcode,
    province.taxcode,
    county.countyname as county,
    district.districtname as district,
    zone.alternateName as zone,
    neighbourhood.alternateName as neigbhour,
    city.cityname as city,
    city.taxcode,
    city.fdocode,
                        $defaultSelectClause
                        </selectClause>
                        <tableClause>
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        </tableClause>
                        <!-- <whereClause>($defaultWhereClause)
                        </whereClause> -->
                </operationBinding>
        </operationBindings>
</DataSource>


Below is the Server Logs

Code:

=== 2014-12-10 11:48:53,749 [6-27] DEBUG RPCManager - Processing 1 requests.
=== 2014-12-10 11:48:53,759 [6-27] DEBUG ISCKeyedObjectPool - Borrowing object for 'CusNeiGroupDS'
=== 2014-12-10 11:48:53,759 [6-27] DEBUG PoolableDataSourceFactory - Activated DataSource 26 of type 'CusNeiGroupDS'
=== 2014-12-10 11:48:53,759 [6-27] DEBUG DSRequest - Caching instance 26 of DS 'CusNeiGroupDS' from DSRequest.getDataSource()
=== 2014-12-10 11:48:53,759 [6-27] DEBUG DSRequest - Caching instance 26 of DS CusNeiGroupDS
=== 2014-12-10 11:48:53,759 [6-27] DEBUG RPCManager - Request #1 (DSRequest) payload: {
    criteria:{
    },
    operationConfig:{
        dataSource:"CusNeiGroupDS",
        operationType:"fetch",
        textMatchStyle:"substring"
    },
    startRow:0,
    endRow:75,
    componentId:"isc_ListGrid_0",
    appID:"builtinApplication",
    operation:"CusNeiGroupDS_fetch",
    oldValues:{
    }
}
=== 2014-12-10 11:48:53,759 [6-27] INFO  IDACall - Performing 1 operation(s)
=== 2014-12-10 11:48:53,759 [6-27] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2014-12-10 11:48:53,759 [6-27] DEBUG DeclarativeSecurity - DataSource CusNeiGroupDS is not in the pre-checked list, processing...
=== 2014-12-10 11:48:53,769 [6-27] DEBUG AppBase - [builtinApplication.CusNeiGroupDS_fetch] No userTypes defined, allowing anyone access to all operations for this application
=== 2014-12-10 11:48:53,769 [6-27] DEBUG AppBase - [builtinApplication.CusNeiGroupDS_fetch] No public zero-argument method named '_CusNeiGroupDS_fetch' found, performing generic datasource operation
=== 2014-12-10 11:48:53,769 [6-27] INFO  SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] Performing fetch operation with
        criteria: {}        values: {}
=== 2014-12-10 11:48:53,779 [6-27] INFO  SQLWhereClause - [builtinApplication.CusNeiGroupDS_fetch] empty condition
=== 2014-12-10 11:48:53,779 [6-27] INFO  SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] derived query: SELECT
                        province.capital,
    province.code,
    province.telcode,
    province.taxcode,
    county.countyname as county,
    district.districtname as district,
    zone.alternateName as zone,
    neighbourhood.alternateName as neigbhour,
    city.cityname as city,
    city.taxcode,
    city.fdocode,
                        $defaultSelectClause
                        FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE $defaultWhereClause
=== 2014-12-10 11:48:53,860 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] Executing row count query: SELECT COUNT(*) FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE $defaultWhereClause
=== 2014-12-10 11:48:53,860 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] Eval'd row count query: SELECT COUNT(*) FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE ('1'='1')
=== 2014-12-10 11:48:53,910 [6-27] INFO  PoolManager - [builtinApplication.CusNeiGroupDS_fetch] SmartClient pooling started for 'SQLServer' objects
=== 2014-12-10 11:48:53,910 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] Initializing SQL config for 'SQLServer' from system config - using DriverManager:  net.sourceforge.jtds.jdbc.Driver
=== 2014-12-10 11:48:53,910 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] net.sourceforge.jtds.jdbc.Driver lookup successful
=== 2014-12-10 11:48:53,910 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] DriverManager fetching connection for SQLServer via jdbc url jdbc:jtds:sqlserver://localhost:1433;DatabaseName=kaizenweb;useUnicode=true;characterEncoding=UTF-8;sendStringAsUnicode=true;User=test;Password=secret
=== 2014-12-10 11:48:53,910 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] Passing JDBC URL only to getConnection
=== 2014-12-10 11:48:54,399 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] makeObject() created a pooled Connection '28326982'
=== 2014-12-10 11:48:54,409 [6-27] DEBUG SQLConnectionManager - [builtinApplication.CusNeiGroupDS_fetch] Borrowed connection '28326982'
=== 2014-12-10 11:48:54,409 [6-27] DEBUG SQLDriver - [builtinApplication.CusNeiGroupDS_fetch] About to execute SQL query in 'SQLServer' using connection '28326982'
=== 2014-12-10 11:48:54,409 [6-27] INFO  SQLDriver - [builtinApplication.CusNeiGroupDS_fetch] Executing SQL query on 'SQLServer': SELECT COUNT(*) FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE ('1'='1')
=== 2014-12-10 11:48:54,439 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] DriverManager fetching connection for SQLServer via jdbc url jdbc:jtds:sqlserver://localhost:1433;DatabaseName=kaizenweb;useUnicode=true;characterEncoding=UTF-8;sendStringAsUnicode=true;User=test;Password=secret
=== 2014-12-10 11:48:54,439 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] Passing JDBC URL only to getConnection
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLConnectionManager - [builtinApplication.CusNeiGroupDS_fetch] Borrowed UNPOOLED connection '6679247'
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLServerDriver - [builtinApplication.CusNeiGroupDS_fetch] SQL Server version is '10.50.1600'
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] Using SQL Limit query
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] Using PK as default sorter: province
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY province) AS rowID FROM (SELECT TOP 100 PERCENT 
                        province.capital,
    province.code,
    province.telcode,
    province.taxcode,
    county.countyname as county,
    district.districtname as district,
    zone.alternateName as zone,
    neighbourhood.alternateName as neigbhour,
    city.cityname as city,
    city.taxcode,
    city.fdocode,
                        CusNeiGroupDS.province, CusNeiGroupDS.capital, CusNeiGroupDS.code, CusNeiGroupDS.telcode, CusNeiGroupDS.taxcode, CusNeiGroupDS.county, CusNeiGroupDS.district, CusNeiGroupDS.city, CusNeiGroupDS.zone, CusNeiGroupDS.neighbour, CusNeiGroupDS.taxcodecity, CusNeiGroupDS.fdocode, CusNeiGroupDS.countCustomer
                        FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE ('1'='1')) x) y WHERE y.rowID BETWEEN 1 AND 75
=== 2014-12-10 11:48:54,439 [6-27] DEBUG SQLDataSource - [builtinApplication.CusNeiGroupDS_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY province) AS rowID FROM (SELECT TOP 100 PERCENT 
                        province.capital,
    province.code,
    province.telcode,
    province.taxcode,
    county.countyname as county,
    district.districtname as district,
    zone.alternateName as zone,
    neighbourhood.alternateName as neigbhour,
    city.cityname as city,
    city.taxcode,
    city.fdocode,
                        CusNeiGroupDS.province, CusNeiGroupDS.capital, CusNeiGroupDS.code, CusNeiGroupDS.telcode, CusNeiGroupDS.taxcode, CusNeiGroupDS.county, CusNeiGroupDS.district, CusNeiGroupDS.city, CusNeiGroupDS.zone, CusNeiGroupDS.neighbour, CusNeiGroupDS.taxcodecity, CusNeiGroupDS.fdocode, CusNeiGroupDS.countCustomer
                        FROM
                                province
                                JOIN county ON province.Id = county.provinceId
                                JOIN district ON district.countyId = county.Id
                                JOIN city ON city.districtId = district.Id
                                JOIN zone ON zone.cityId = city.Id
                                JOIN neighbourhood ON neighbourhood.zoneId = zone.Id
                                JOIN customer ON customer.neighbourhoodId = neighbourhood.Id
                        WHERE ('1'='1')) x) y WHERE y.rowID BETWEEN 1 AND 75
=== 2014-12-10 11:48:54,449 [6-27] DEBUG SQLConnectionManager - [builtinApplication.CusNeiGroupDS_fetch] About to close  with hashcode "28326982"
=== 2014-12-10 11:48:54,449 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] DriverManager fetching connection for SQLServer via jdbc url jdbc:jtds:sqlserver://localhost:1433;DatabaseName=kaizenweb;useUnicode=true;characterEncoding=UTF-8;sendStringAsUnicode=true;User=test;Password=secret
=== 2014-12-10 11:48:54,449 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] Passing JDBC URL only to getConnection
=== 2014-12-10 11:48:54,449 [6-27] DEBUG PoolableSQLConnectionFactory - [builtinApplication.CusNeiGroupDS_fetch] makeObject() created a pooled Connection '6960514'
=== 2014-12-10 11:48:54,459 [6-27] DEBUG DSRequest - About to free up resources for request of type fetch on DataSource CusNeiGroupDS
=== 2014-12-10 11:48:54,459 [6-27] WARN  RequestContext - dsRequest.execute() failed:
java.sql.SQLException: The multi-part identifier "CusNeiGroupDS.province" could not be bound.
        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)
        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2258)
        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:632)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:477)
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeQuery(JtdsStatement.java:1311)
        at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
        at com.isomorphic.sql.SQLDataSource.executeWindowedSelect(SQLDataSource.java:2507)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1907)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:443)
        at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:388)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:1922)
        at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:726)
        at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
        at com.isomorphic.application.AppBase.execute(AppBase.java:491)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2543)
        at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:213)
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:178)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:142)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:156)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:83)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:745)
=== 2014-12-10 11:48:54,459 [6-27] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
=== 2014-12-10 11:48:54,459 [6-27] DEBUG RPCManager - non-DMI response, dropExtraFields: false
=== 2014-12-10 11:48:54,459 [6-27] DEBUG SQLDriver - Freeing SQLDriver dbConnection 6960514
=== 2014-12-10 11:48:54,459 [6-27] DEBUG SQLConnectionManager - About to close  with hashcode "6960514"
=== 2014-12-10 11:48:54,459 [6-27] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 26 of type 'CusNeiGroupDS'
=== 2014-12-10 11:48:54,459 [6-27] INFO  Compression - /builtinds/sc/IDACall: 208 -> 179 bytes


Viewing all articles
Browse latest Browse all 4756