Discussions

Web tier: servlets, JSP, Web frameworks: How to use FormattedDataSet...

  1. How to use FormattedDataSet... (2 messages)

    Hi, i was trying to use the com.fdspi but i can't generate any right result. Using Tomcat 4.0 and MS Access Database but an internal error message is the result.

    My table name is "Customer" table, and this is my coding, a jsp file saved as "test.jsp".



    <%@page contentType="text/html"%>
    <%@ page language="java" buffer="8kb" autoFlush="true" isThreadSafe="true" info="Info

    string" isErrorPage="false" %>
    <%@ page import="java.util.*, com.fdsapi.*, com.jamonapi.*" %>
    <%@ page import="java.sql.*" %>

    <%

    DataAccess da = new DataAccessClient("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Database",true);
    FormattedDataSet fds=FormattedDataSet.createInstance();
    fds.setDataAccessFactory(da);
    String quere = "SELECT * FROM Customer";
    Monitor mon=MonitorFactory.start("fdsapi.page.test");
    String html = fds.getFormattedDataSet(quere, "htmlTable");

    %>


    <%= html%>

    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="css/formatteddataset.css">
    <title></title>

    </head>
    <body>


    </body>
    </html>
  2. How to use FormattedDataSet...[ Go to top ]

    what is the error ??
  3. How to use FormattedDataSet...[ Go to top ]

    I've seen problems with the access jdbc driver. The following fixed the problem. Let me know if this doesn't work.

    Steve - http://www.fdsapi.com



    [code]
    ...
    FormattedDataSet fds=FormattedDataSet.createInstance();
    fds.setDataAccessFactory(da);
    String quere = "SELECT * FROM Customer";
    Monitor mon=MonitorFactory.start("fdsapi.page.test");

    ResultSetConverter rsc=fds.getResultSetConverter(quere);

    String html = fds.getFormattedDataSet(rsc, "htmlTable");
    [/code]