Good idea kelvin, but I'm begginer in servlet and I don't know what would be
the best way for the user to provide the connection and sql. Though I tried
this:

import java.io.IOException;
import java.sql.DriverManager;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest ;
import javax.servlet.http.HttpServletResponse;

import org.apache.tuscany.das.rdb.Command;
import org.apache.tuscany.das.rdb.DAS;

import commonj.sdo.DataObject;

public class CommandServlet extends HttpServlet {

   private static final long serialVersionUID = 1922159305255311505L;

   public CommandServlet() {}

   protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
       DataObject items = test(getConnection(), "SELECT id FROM item WHERE
id = 1;");
       System.out.println("id = " + items.getInt("ITEM[1]/ID"));

   }

   public DataObject test(java.sql.Connection conn, String readSql) {
       DAS das = DAS.FACTORY.createDAS(conn);

       Command command = das.createCommand();
       DataObject allItems = command.executeQuery();

       return allItems;

   }

   }

}

Adriano Crestani

On 2/8/07, Kevin Williams <[EMAIL PROTECTED]> wrote:

You could actually start significantly simpler by making the following
assumptions:

   1. Read of a single table
   2. User provides SQL programatically
   3. User provides Connection programatically

With these restrictions you can get something useful working without the
classes required for config-file support.

--
Kevin


Adriano Crestani wrote:

> Luciano suggested to implement at first, the necessary classes to
> create a
> simple app that only reads from a database using the das c++. I was
> checking
> on the das java that these classes below are essential to create this
> app.
>
> DAS
> DASFactory
> DASImpl
> ConfigFactory
> ConfigFactoryImpl
> Config
> MappingWrapper
> config.Command
> ReadCommandImpl
> Command
> CommandImpl
> ConnectionInfo
>
>
> All these classes may be found in das java. I'm needing some
> volunteers to
> help implement these classes in c++. Actually, these classes are
> implemented, but are not compiling yet. So we need these classes
> compiling
> and implement a simple read app with these classes.
>
> Any suggestion will be appreciated.
>
> Adriano Crestani
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to