• 3 replies
  • Latest Post - ‏2010-01-04T21:28:13Z by DGawron
2 Posts

Pinned topic Error in fetching data in MySQL

‏2009-12-27T09:55:32Z |
i am trying to build my first application about accessing MySQL and retrieving data. But it fails.
i already established a database pool in WASCE. And the pool points to database "sample".
I tried to run SQL("select id,name from employee") in WASCE console, it successed.
I also followed the action in "usage" of WASCE console and configure some references in the web.xml, geronimo-web.xml in order to refer to the datasource.

i created "Database Service Provider" model in WPF, and use the pop down option "java:comp/env/jdbc/MyDataSource" as DataSouce.(The opt is pop down by WPF automatically)
i add SQL "Select id,name from EMPLOYEE"
But it alert an error message. I checked the log. It reports that "java.sql.SQLException: Table/View 'EMPLOYEE' does not exist."
Certainly, the table "EMPLOYEE" exist in database.
And i tried to modify SQL for adding database name in front of table name "Select id,name from sample.EMPLOYEE"
It alert "java.sql.SQLException: Schema 'SAMPLE' does not exist".

Do you have any idea or suggestion?
Thank you.
Updated on 2010-01-04T21:28:13Z at 2010-01-04T21:28:13Z by DGawron
  • myredbox
    2 Posts

    Re: Error in fetching data in MySQL

    I also supply some key information as belw:

    1. I add reference content in WEB-INF/web.xml:

    2. I modified "WEB-INF/geronimo-web.xml" as below,

    <?xml version="1.0" encoding="UTF-8"?>


    <!-- security settings, if any, go here -->

  • DGawron
    251 Posts

    Re: Error in fetching data in MySQL

    Try using the Database Explorer section of the SQL Call builder to generate the select for you. If SQL Call can see the MySQL datasource, then it will be able to generate a sample select statement for you.
  • DGawron
    251 Posts

    Re: Error in fetching data in MySQL

    One more thing. MySQL isn't an officially supported database. If you are planning to use MySQL for a production deployment with WPF, then you may want to take that into account. The WPF release notes ( list the supported databases for each release. If you decide to use MySQL, then we'll only be able to offer best-effort support if you run into any problems.