1 Reply Latest reply on Feb 16, 2009 9:57 PM by Peter Johnson


    Jotnarta Zabin Newbie

      Hi All
      I posted my problem in all Java and J2EE forums, I hope I can find a solution here. I am trying to test DataSource in JBoss; so, I defined the mysql-ds.xml file:

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

      and this is my jsp file:
      <%@page import="java.util.*,javax.naming.*,javax.sql.DataSource,java.sql.*"%>
       DataSource ds = null;
       Connection con = null;
       //Statement st = null;
       InitialContext ic;
       try {
       ic = new InitialContext();
       ds = (DataSource) ic.lookup("java:/DefaultDS");
       con = ds.getConnection();
       Statement st = con.createStatement();
       ResultSet rs = st.executeQuery("select * from quest_choices;");
       while(rs.next()) {
       out.println("<br> " + rs.getString("ID"));
       } catch (Exception e) {
       out.println("Exception thrown " + e );
       } finally {
       if (con != null) {

      I got the following error:
      Exception thrown java.sql.SQLException: Table not found in statement [select * from quest_choices]

      Any help pleeeeeeeeeeeeeeeease????