As anyone didn't choose any specific class. So I will define:

Me:
MappingWrapper
config.Command
ReadCommandImpl

Dannyel:
Command
CommandImpl
ConnectionInfo

Douglas:
ConfigFactory
ConfigFactoryImpl
Config

Willian:
DAS
DASFactory
DASImpl

For while I'd like you just to analyze these classes. Also  simple read app.


I created the app below using das java and you may study and debug it just
to check how it works.

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 {
       java.sql.Connection conn = getConnection();
       DAS das = DAS.FACTORY.createDAS(conn);

       Command command = das.createCommand("select * from item;");
       DataObject allItems = command.executeQuery();

       System.out.println("testeee = " + allItems.getInt("ITEM[1]/ID"));

   }

   private static java.sql.Connection getConnection() {
       try {
           Class.forName("com.mysql.jdbc.Driver");
           java.sql.Connection con = DriverManager.getConnection(
"jdbc:mysql://localhost:3306/shoppingcart","root","tuscany");
           con.setAutoCommit(false);
           return con;
       } catch(Exception e) {
           e.printStackTrace();
           return null;
       }

   }

}


If anyone require any guidance to create a project and run the app I may
help. But it is simple:

- Create a web app project on netbeans;

- Add a new servlet to this project and copy the code above in it;

- Create an "item" table containing an integer attribute named "ID" on mysql
database named "shoopingcart". You may choose another dbms, but then you
will have to do the some modifications on the code.

- The necessary .jar files you may find here:
http://incubator.apache.org/tuscany/sdo_downloads.html
http://incubator.apache.org/tuscany/sdo_downloads.html
And the mysql jdbc you may find in mysql site.

I expect you run and debug it for better understading of each class you are
going to implement and evaluate which methods really need to be implemented
initially, cause not all methods of these classes are used for this simple
app.

Any suggestion about the app above will be appreciated.

Adriano Crestani


On 2/8/07, Douglas Leite <[EMAIL PROTECTED]> wrote:

Ok, I´ll help you to solve the compiler erros of these classes.

On 2/8/07, Willian Yabusame Maja <[EMAIL PROTECTED]> wrote:
>
> I could help to implement some of these classes.
>
> ----- Original Message -----
> From: "Adriano Crestani" <[EMAIL PROTECTED]>
> To: <tuscany-dev@ws.apache.org>
> Sent: Thursday, February 08, 2007 3:56 AM
> Subject: [DAS C++] Necessary classes for a initial simple read
application
>
>
> > 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