You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Adriano Crestani <ad...@gmail.com> on 2007/02/08 06:56:05 UTC

[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

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
>> Sorry Luciano, but what is a webApp skeleton? Could you give an example?

I was saying more like an empty project, where people would just copy and
start putting their code on the right place... but I think this is more
towards documentation.

-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> I looked at the maven for netbeans page and it seems interesting, but I
> didn't have time to test it yet.
>
> Sorry Luciano, but what is a webApp skeleton? Could you give an example?
>
>
> On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Except for the instructions related to NetBeans, most of these steps are
> > defined on the following two links:
> >    http://incubator.apache.org/tuscany/java-projects.html
> > or
> >    http://incubator.apache.org/tuscany/java_das_overview.html
> >
> > Probably would be better for you to review these links and suggest
> > enhancements, as most new users will probably have the same issues as
> you
> > guys are having.
> >
> > The netBeans steps could probably also be appended to the
> > java-projects.htmllink, together with the instructions on how to use
> > Eclipse or IDEA. BTW,
> > have you seen this :
> >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> >
> >
> > Looks like there is a plugin that does the creation of the netBeans
> > project
> > files from the pom
> >
> > mvn netbeans-freeform:generate-netbeans-project
> >
> >
> > Then, for the webAPP, maybe it's easy if you provide a webApp
> > skeleton, then people could only import the war file.
> >
> > Toughts ? Does the link help ?
> >
> >
> > --
> > Luciano Resende
> > http://people.apache.org/~lresende <http://people.apache.org/%7Elresende
> >
> >
> > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > As me and Dannyel had some trouble on building and debugging this
> simple
> > > read app using das java, I created this short howTo to help anyone
> else
> > > that
> > > is also having difficult to create a project on netbeans IDE to debbug
> > the
> > > code.
> > >
> > > 1 - download subversion(
> http://subversion.tigris.org/project_packages.html
> >
> > > )
> > > and unpack it
> > >
> > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html) and
> > > unpack
> > > it
> > >
> > > 3 - set maven/bin and subversion/bin in your SO path
> > >
> > > 4 - create a folder called, i. e. Tuscany, and download the java
> source
> > > executing the following commands:
> > >
> > > cd tuscany
> > >
> > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > >
> > > It will probably ask you if you accept the secure connection, than
> allow
> > > it.
> > >
> > > 5 - Now, download the dependencies:
> > >
> > > cd java/das
> > >
> > > mvn
> > >
> > > The dependencies should be downloaded.  Let us know if you get any
> build
> > > error on this part.
> > >
> > > 6 - Run Netbeans and select File >> New Project.... Select "General"
> on
> > > categories and then "Java Project with Existing Sources" then click on
> > > next
> > >
> > > 7 - Give a name to your project, i.e. "DAS", select its folder and
> click
> > > on
> > > next.
> > >
> > > 8 - Click on the first button "Add Folder..." and select the following
> > > folders:
> > >
> > > Tuscany\java\das\rdb\src\main\java
> > >
> > > Tuscany\java\das\rdb\target\sdo-source
> > >
> > > Click on "Finish"
> > >
> > > 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
> > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > >
> > > 10 - Right click on DAS project and select properties. Then select
> > > libraries
> > > and click on "Add JAR/Folder". Select all the files the folder
> > > Lib\tuscany-
> > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > >
> > > 11 - Again select File >> New Project... select "Web" on categories
> and
> > > "Web
> > > Application" then click on next.
> > >
> > > 12 - Give a name to your project, i.e. SimpleReadApp, select its
> folder
> > > and
> > > click on finish.
> > >
> > > 13 - Right click on you SimpleReadApp project and select New >>
> Servlet.
> >
> > > Give a name to your servlet, i.e. CommandServlet and click on finish.
> A
> > > new
> > > .java file will be created in SimpleReadApp's Source Packages, open it
> > and
> > > copy the CommandServlet class code in it.
> > >
> > > 14 - Right click on you SimpleReadApp project and select properties.
> > Then
> > > select libraries and click on "Add JAR/Folder". Select the file
> > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside
> the
> > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on
> "Open".
> > >
> > > 15 - On the same window click on "Add Project...", select the DAS
> > project
> > > folder and click on open.
> > >
> > > Now you already have what is necessary to run and debug the code.
> Don't
> > > forget to do the adjustments for your dbms:
> > >
> > >   - set the jdbc jar file
> > >
> > >   - modify the sql statement according to your dbms pl/sql
> > >
> > >   - modify the in getConnection method  the jdbc driver class path,
> the
> > > database path, user and password
> > >
> > >   - create in your database having an table called "ITEM" that has an
> > > integer attribute called "ID". You must also insert at least an row in
> > > this
> > > table.
> > >
> > > I expect you to debug this simple read app and see for yourselves
> which
> > > classes and methods are needed to implement the simple read app. Then
> > pick
> > > the classes you want to implement and create a JIRA for it ; )
> > >
> > > Adriano Crestani
> > >
> > >
> > > On 2/9/07, Douglas Leite <do...@gmail.com> wrote:
> > > >
> > > > Good ideia.... I´ll do it.
> > > >
> > > > On 2/9/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > I have an idea to make it more independent. Each one that wants to
> > > help
> > > > to
> > > > > implement this simple app, evaluate which class is intended to
> > > implement
> > > > > and
> > > > > create a new JIRA for it. In this new JIRA should be described the
> > > > classes
> > > > > and their methods that will be implemented. This way if someone
> > finish
> > > > to
> > > > > implement certain classes, he will be able to choose another
> classes
> > > to
> > > > > implement, instead of waiting for others to finish their classes.
> I
> > > > think
> > > > > this way we may speed up the das c++ coding.
> > > > >
> > > > > Please, if a new JIRA is created report it here in this thread.
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > > On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
> > > > > >
> > > > > > Okay Adriano.... I will try to understand the simple application
> > > that
> > > > > > you´ve
> > > > > > posted, step by step, and after that I will choose some useful
> > > classes
> > > > > as
> > > > > > well as their essentials methods to run that application in C++.
> > > > > >
> > > > > > Douglas S. Leite
> > > > > >
> > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > Yes Luciano, but I wasn't sure if there would be any problem
> if
> > > the
> > > > > > config
> > > > > > > classes wouldn't be included. We will try to run it without
> the
> > > > config
> > > > > > > classes though.
> > > > > > >
> > > > > > > Douglas, as I had assigned the config classes to you just pick
> > > some
> > > > > > > classes
> > > > > > > from those I've assigned to the others. Or if you have another
> > > > > > suggestion
> > > > > > > in
> > > > > > > what you could be useful just let us know.
> > > > > > >
> > > > > > > Adriano Crestani
> > > > > > >
> > > > > > > On 2/8/07, Luciano Resende <luckbr1975@gmail.com > wrote:
> > > > > > > >
> > > > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > > > > application
> > > > > > > > that
> > > > > > > > only performs a simple read, you shouldn't need the config
> > > > classes,
> > > > > > try
> > > > > > > to
> > > > > > > > do in C++ something simple as the java sample you just
> posted
> > > > here.
> > > > > > > >
> > > > > > > > As for downloads, you only need to download the DAS
> > > distribution,
> > > > > that
> > > > > > > > will
> > > > > > > > contain all the SDO and other dependencies inside the zip.
> For
> >
> > > the
> > > > > new
> > > > > > > > people, I'd recommend using the stable M2 distributions,
> > > although
> > > > I
> > > > > > > think
> > > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Luciano Resende
> > > > > > > > http://people.apache.org/~lresende
> > <http://people.apache.org/%7Elresende>
> > > > > > > >
> > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> wrote:
> > > > > > > > >
> > > > > > > > > A correction, there is need to download the das also, not
> > only
> > > > the
> > > > > > sdo
> > > > > > > > > .jar:
> > > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > >
> > > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > wrote:
> > > > > > > > > >
> > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes the
> > > first
> > > > > code
> > > > > > I
> > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > >
> > > > > > > > > > > Adriano Crestani
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Your focus should probably be on the APIs your DAS
> > will
> > > > > > provide
> > > > > > > > the
> > > > > > > > > > > > user
> > > > > > > > > > > > whether that is from a servlet or some other
> > > caller.  Here
> > > > > are
> > > > > > > the
> > > > > > > > > > > > Java
> > > > > > > > > > > > DAS apis from the simplest possible read in the test
> > > > suite:
> > > > > > > > > > > >
> > > > > > > > > > > >         /**
> > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > >          */
> > > > > > > > > > > >         public void testReadSingle() throws
> Exception
> > {
> > > > > > > > > > > >
> > > > > > > > > > > >             // Create and initialize command to read
> > > > > customers
> > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > (getConnection());
> > > > > > > > > > > >             Command readCustomers =
> das.createCommand
> > > > > ("select
> > > > > > *
> > > > > > > > from
> > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > >
> > > > > > > > > > > >             // Read
> > > > > > > > > > > >             DataObject root =
> > readCustomers.executeQuery
> > > > ();
> > > > > > > > > > > >
> > > > > > > > > > > >             // Verify
> > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > >         }
> > > > > > > > > > > >
> > > > > > > > > > > > Notice that this example also does not allow
> > > parameterized
> > > > > > > > > queries.  I
> > > > > > > > > > > >
> > > > > > > > > > > > would make this simplifying assumption to get
> > something
> > > up
> > > > > and
> > > > > > > > > > > > running.
> > > > > > > > > > > >
> > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> > Connection
> > > > but
> > > > > I
> > > > > > > am
> > > > > > > > > sure
> > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Kevin
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > 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.Connectionconn,
> > > > 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 <ke...@qwest.net>
> > 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:
> > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > >>
> > > > > > > > > > > > >>
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
Here is a good manual about ODBC:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2.doc.pdf/dsnodj13.pdf?noframes=true

Adriano Crestani

On 3/1/07, Luciano Resende <lu...@gmail.com> wrote:
>
> This might also be interesting read for you guys...
> http://wiki.apache.org/ws/Tuscany/TuscanyCpp/DesignNotes
>
> On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > Sorry guys, the sdo article url I gave is wrong, the correctly url is:
> > http://www-128.ibm.com/developerworks/webservices/library/ws-sdo-api/
> >
> > Adriano Crestani
> >
> > On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > Thanks for the clarification. Makes sense now.
> > >
> > > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > I gave this name just cause it doesn't have all the classes and
> > > > fuctionality
> > > > of a real DAS library. But it will later become a complete DAS
> > library,
> > > I
> > > > expect ; ). You may call also DAS "initial phase", I don't know.
> > > >
> > > > Adriano Crestani
> > > >
> > > > On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > >
> > > > > Hi Adriano
> > > > >
> > > > >    What's the difference between DAS C++ and DAS C++ lite ? Why we
> > > would
> > > > > need two ? I thought one DAS was already too much work :)
> > > > >
> > > > > --
> > > > > Luciano Resende
> > > > > http://people.apache.org/~lresende
> > > > >
> > > > > On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > I created a JIRA(
> > https://issues.apache.org/jira/browse/TUSCANY-1140)
> > > > to
> > > > > > implement the DAS Lite Command classes that I described here:
> > > > > >
> > > http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
> > > > > >
> > > > > > Hey guys, I read this article
> > > > > > https://issues.apache.org/jira/browse/TUSCANY-1140 and I think
> you
> > > > will
> > > > > > like
> > > > > > that, it tells a lot about how c++ sdo works ; )
> > > > > >
> > > > > > Adriano Crestani
> > > > > >
> > > > > > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > I looked at the maven for netbeans page and it seems
> > interesting,
> > > > but
> > > > > I
> > > > > > > didn't have time to test it yet.
> > > > > > >
> > > > > > > Sorry Luciano, but what is a webApp skeleton? Could you give
> an
> > > > > example?
> > > > > > >
> > > > > > >
> > > > > > > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Except for the instructions related to NetBeans, most of
> these
> > > > steps
> > > > > > are
> > > > > > > > defined on the following two links:
> > > > > > > >    http://incubator.apache.org/tuscany/java-projects.html
> > > > > > > > or
> > > > > > > >
> http://incubator.apache.org/tuscany/java_das_overview.html
> > > > > > > >
> > > > > > > > Probably would be better for you to review these links and
> > > suggest
> > > > > > > > enhancements, as most new users will probably have the same
> > > issues
> > > > > as
> > > > > > > > you
> > > > > > > > guys are having.
> > > > > > > >
> > > > > > > > The netBeans steps could probably also be appended to the
> > > > > > > > java-projects.htmllink, together with the instructions on
> how
> > to
> > > > use
> > > > > > > > Eclipse or IDEA. BTW,
> > > > > > > > have you seen this :
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > > > > > > >
> > > > > > > >
> > > > > > > > Looks like there is a plugin that does the creation of the
> > > > netBeans
> > > > > > > > project
> > > > > > > > files from the pom
> > > > > > > >
> > > > > > > > mvn netbeans-freeform:generate-netbeans-project
> > > > > > > >
> > > > > > > >
> > > > > > > > Then, for the webAPP, maybe it's easy if you provide a
> webApp
> > > > > > > > skeleton, then people could only import the war file.
> > > > > > > >
> > > > > > > > Toughts ? Does the link help ?
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Luciano Resende
> > > > > > > > http://people.apache.org/~lresende<
> > > > > > http://people.apache.org/%7Elresende>
> > > > > > > >
> > > > > > > > On 2/16/07, Adriano Crestani <ad...@gmail.com>
> > wrote:
> > > > > > > > >
> > > > > > > > > As me and Dannyel had some trouble on building and
> debugging
> > > > this
> > > > > > > > simple
> > > > > > > > > read app using das java, I created this short howTo to
> help
> > > > anyone
> > > > > > > > else
> > > > > > > > > that
> > > > > > > > > is also having difficult to create a project on netbeans
> IDE
> > > to
> > > > > > debbug
> > > > > > > > the
> > > > > > > > > code.
> > > > > > > > >
> > > > > > > > > 1 - download subversion(
> > > > > > http://subversion.tigris.org/project_packages.html
> > > > > > > > > )
> > > > > > > > > and unpack it
> > > > > > > > >
> > > > > > > > > 2 - download maven 2.0.4 (
> > > http://maven.apache.org/download.html)
> > > > > > and
> > > > > > > > > unpack
> > > > > > > > > it
> > > > > > > > >
> > > > > > > > > 3 - set maven/bin and subversion/bin in your SO path
> > > > > > > > >
> > > > > > > > > 4 - create a folder called, i. e. Tuscany, and download
> the
> > > java
> > > > > > > > source
> > > > > > > > > executing the following commands:
> > > > > > > > >
> > > > > > > > > cd tuscany
> > > > > > > > >
> > > > > > > > > svn co
> > https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > > > > > > >
> > > > > > > > > It will probably ask you if you accept the secure
> > connection,
> > > > than
> > > > > > > > allow
> > > > > > > > > it.
> > > > > > > > >
> > > > > > > > > 5 - Now, download the dependencies:
> > > > > > > > >
> > > > > > > > > cd java/das
> > > > > > > > >
> > > > > > > > > mvn
> > > > > > > > >
> > > > > > > > > The dependencies should be downloaded.  Let us know if you
> > get
> > > > any
> > > > > > > > build
> > > > > > > > > error on this part.
> > > > > > > > >
> > > > > > > > > 6 - Run Netbeans and select File >> New Project.... Select
> > > > > "General"
> > > > > > > > on
> > > > > > > > > categories and then "Java Project with Existing Sources"
> > then
> > > > > click
> > > > > > on
> > > > > > > > > next
> > > > > > > > >
> > > > > > > > > 7 - Give a name to your project, i.e. "DAS", select its
> > folder
> > > > and
> > > > > > > > click
> > > > > > > > > on
> > > > > > > > > next.
> > > > > > > > >
> > > > > > > > > 8 - Click on the first button "Add Folder..." and select
> the
> > > > > > following
> > > > > > > > > folders:
> > > > > > > > >
> > > > > > > > > Tuscany\java\das\rdb\src\main\java
> > > > > > > > >
> > > > > > > > > Tuscany\java\das\rdb\target\sdo-source
> > > > > > > > >
> > > > > > > > > Click on "Finish"
> > > > > > > > >
> > > > > > > > > 9 - Unpack the file
> > > > > Tuscany\java\das\distribution\binary\target\das-
> > > > > > > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > > > > > > >
> > > > > > > > > 10 - Right click on DAS project and select properties.
> Then
> > > > select
> > > > > > > > > libraries
> > > > > > > > > and click on "Add JAR/Folder". Select all the files the
> > folder
> > > > > > > > > Lib\tuscany-
> > > > > > > > > das-1.0-incubator-SNAPSHOT\lib contains and click on
> "Open".
> > > > > > > > >
> > > > > > > > > 11 - Again select File >> New Project... select "Web" on
> > > > > categories
> > > > > > > > and
> > > > > > > > > "Web
> > > > > > > > > Application" then click on next.
> > > > > > > > >
> > > > > > > > > 12 - Give a name to your project, i.e. SimpleReadApp,
> select
> > > its
> > > > > > > > folder
> > > > > > > > > and
> > > > > > > > > click on finish.
> > > > > > > > >
> > > > > > > > > 13 - Right click on you SimpleReadApp project and select
> New
> > > >>
> > > > > > > > Servlet.
> > > > > > > > > Give a name to your servlet, i.e. CommandServlet and click
> > on
> > > > > > finish.
> > > > > > > > A
> > > > > > > > > new
> > > > > > > > > .java file will be created in SimpleReadApp's Source
> > Packages,
> > > > > open
> > > > > > it
> > > > > > > > and
> > > > > > > > > copy the CommandServlet class code in it.
> > > > > > > > >
> > > > > > > > > 14 - Right click on you SimpleReadApp project and select
> > > > > properties.
> > > > > > > > Then
> > > > > > > > > select libraries and click on "Add JAR/Folder". Select the
> > > file
> > > > > > > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that
> > resides
> > > > > inside
> > > > > > > > the
> > > > > > > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and
> click
> > > on
> > > > > > > > "Open".
> > > > > > > > >
> > > > > > > > > 15 - On the same window click on "Add Project...", select
> > the
> > > > DAS
> > > > > > > > project
> > > > > > > > > folder and click on open.
> > > > > > > > >
> > > > > > > > > Now you already have what is necessary to run and debug
> the
> > > > code.
> > > > > > > > Don't
> > > > > > > > > forget to do the adjustments for your dbms:
> > > > > > > > >
> > > > > > > > >   - set the jdbc jar file
> > > > > > > > >
> > > > > > > > >   - modify the sql statement according to your dbms pl/sql
> > > > > > > > >
> > > > > > > > >   - modify the in getConnection method  the jdbc driver
> > class
> > > > > path,
> > > > > > > > the
> > > > > > > > > database path, user and password
> > > > > > > > >
> > > > > > > > >   - create in your database having an table called "ITEM"
> > that
> > > > has
> > > > > > an
> > > > > > > > > integer attribute called "ID". You must also insert at
> least
> > > an
> > > > > row
> > > > > > in
> > > > > > > > > this
> > > > > > > > > table.
> > > > > > > > >
> > > > > > > > > I expect you to debug this simple read app and see for
> > > > yourselves
> > > > > > > > which
> > > > > > > > > classes and methods are needed to implement the simple
> read
> > > app.
> > > > > > Then
> > > > > > > > pick
> > > > > > > > > the classes you want to implement and create a JIRA for it
> ;
> > )
> > > > > > > > >
> > > > > > > > > Adriano Crestani
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > Good ideia.... I´ll do it.
> > > > > > > > > >
> > > > > > > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com>
> > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > I have an idea to make it more independent. Each one
> > that
> > > > > wants
> > > > > > to
> > > > > > > >
> > > > > > > > > help
> > > > > > > > > > to
> > > > > > > > > > > implement this simple app, evaluate which class is
> > > intended
> > > > to
> > > > > > > > > implement
> > > > > > > > > > > and
> > > > > > > > > > > create a new JIRA for it. In this new JIRA should be
> > > > described
> > > > > > the
> > > > > > > >
> > > > > > > > > > classes
> > > > > > > > > > > and their methods that will be implemented. This way
> if
> > > > > someone
> > > > > > > > finish
> > > > > > > > > > to
> > > > > > > > > > > implement certain classes, he will be able to choose
> > > another
> > > > > > > > classes
> > > > > > > > > to
> > > > > > > > > > > implement, instead of waiting for others to finish
> their
> > > > > > classes.
> > > > > > > > I
> > > > > > > > > > think
> > > > > > > > > > > this way we may speed up the das c++ coding.
> > > > > > > > > > >
> > > > > > > > > > > Please, if a new JIRA is created report it here in
> this
> > > > > thread.
> > > > > > > > > > >
> > > > > > > > > > > Adriano Crestani
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com>
> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Okay Adriano.... I will try to understand the simple
> > > > > > application
> > > > > > > >
> > > > > > > > > that
> > > > > > > > > > > > you´ve
> > > > > > > > > > > > posted, step by step, and after that I will choose
> > some
> > > > > useful
> > > > > > > > > classes
> > > > > > > > > > > as
> > > > > > > > > > > > well as their essentials methods to run that
> > application
> > > > in
> > > > > > C++.
> > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Douglas S. Leite
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > adrianocrestani@gmail.com>
> > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Yes Luciano, but I wasn't sure if there would be
> any
> > > > > problem
> > > > > > > > if
> > > > > > > > > the
> > > > > > > > > > > > config
> > > > > > > > > > > > > classes wouldn't be included. We will try to run
> it
> > > > > without
> > > > > > > > the
> > > > > > > > > > config
> > > > > > > > > > > > > classes though.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Douglas, as I had assigned the config classes to
> you
> > > > just
> > > > > > pick
> > > > > > > > > some
> > > > > > > > > > > > > classes
> > > > > > > > > > > > > from those I've assigned to the others. Or if you
> > have
> > > > > > another
> > > > > > > > > > > > suggestion
> > > > > > > > > > > > > in
> > > > > > > > > > > > > what you could be useful just let us know.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com>
> > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > I'd agree with Kevin's suggestion, for a simple
> > C++
> > > > > sample
> > > > > > > > > > > application
> > > > > > > > > > > > > > that
> > > > > > > > > > > > > > only performs a simple read, you shouldn't need
> > the
> > > > > config
> > > > > > > > > > classes,
> > > > > > > > > > > > try
> > > > > > > > > > > > > to
> > > > > > > > > > > > > > do in C++ something simple as the java sample
> you
> > > just
> > > > > > > > posted
> > > > > > > > > > here.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > As for downloads, you only need to download the
> > DAS
> > > > > > > > > distribution,
> > > > > > > > > > > that
> > > > > > > > > > > > > > will
> > > > > > > > > > > > > > contain all the SDO and other dependencies
> inside
> > > the
> > > > > zip.
> > > > > > > > For
> > > > > > > > > the
> > > > > > > > > > > new
> > > > > > > > > > > > > > people, I'd recommend using the stable M2
> > > > distributions,
> > > > > > > > > although
> > > > > > > > > > I
> > > > > > > > > > > > > think
> > > > > > > > > > > > > > SDO and DAS trunk code are stable and compiling
> > > fine.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Luciano Resende
> > > > > > > > > > > > > > http://people.apache.org/~lresende
> > > > > > > > <http://people.apache.org/%7Elresende>
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > adrianocrestani@gmail.com>
> > > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > A correction, there is need to download the
> das
> > > > also,
> > > > > > not
> > > > > > > > only
> > > > > > > > > > the
> > > > > > > > > > > > sdo
> > > > > > > > > > > > > > > .jar:
> > > > > > > > > > > > > > >
> > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > > > adrianocrestani@gmail.com>
> > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > > > adrianocrestani@gmail.com
> > > > > > >
> > > > > > > > > wrote:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it
> look
> > > > likes
> > > > > > the
> > > > > > > > > first
> > > > > > > > > > > code
> > > > > > > > > > > > I
> > > > > > > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > On 2/8/07, Kevin Williams <
> > kevincbw@qwest.net
> > > >
> > > > > > wrote:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Your focus should probably be on the
> APIs
> > > your
> > > > > DAS
> > > > > > > > will
> > > > > > > > > > > > provide
> > > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > user
> > > > > > > > > > > > > > > > > > whether that is from a servlet or some
> > other
> > > > > > > > > caller.  Here
> > > > > > > > > > > are
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > > Java
> > > > > > > > > > > > > > > > > > DAS apis from the simplest possible read
> > in
> > > > the
> > > > > > test
> > > > > > > > > > suite:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >         /**
> > > > > > > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > > > > > > >          */
> > > > > > > > > > > > > > > > > >         public void testReadSingle()
> > throws
> > > > > > > > Exception {
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >             // Create and initialize
> > command
> > > > to
> > > > > > read
> > > > > > > > > > > customers
> > > > > > > > > > > > > > > > > >             DAS das =
> > DAS.FACTORY.createDAS
> > > > > > > > > > > (getConnection());
> > > > > > > > > > > > > > > > > >             Command readCustomers =
> > > > > > > > das.createCommand
> > > > > > > > > > > ("select
> > > > > > > > > > > > *
> > > > > > > > > > > > > > from
> > > > > > > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >             // Read
> > > > > > > > > > > > > > > > > >             DataObject root =
> > > > > > > > readCustomers.executeQuery
> > > > > > > > > > ();
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > > > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > > > > > > >         }
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Notice that this example also does not
> > allow
> > > > > > > > > parameterized
> > > > > > > > > > > > > > > queries.  I
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > would make this simplifying assumption
> to
> > > get
> > > > > > > > something
> > > > > > > > > up
> > > > > > > > > > > and
> > > > > > > > > > > > > > > > > > running.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > I cannot help with the C++ equivalent of
> > > JDBC
> > > > > > > > Connection
> > > > > > > > > > but
> > > > > > > > > > > I
> > > > > > > > > > > > > am
> > > > > > > > > > > > > > > sure
> > > > > > > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > > Kevin
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > > 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.Connectionconn,
> > > > > > > > > > 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 <
> > > > kevincbw@qwest.net>
> > > > > > > > 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:
> > > > > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Luciano Resende
> > > http://people.apache.org/~lresende
> > >
> >
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
This might also be interesting read for you guys...
http://wiki.apache.org/ws/Tuscany/TuscanyCpp/DesignNotes

On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> Sorry guys, the sdo article url I gave is wrong, the correctly url is:
> http://www-128.ibm.com/developerworks/webservices/library/ws-sdo-api/
>
> Adriano Crestani
>
> On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Thanks for the clarification. Makes sense now.
> >
> > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > I gave this name just cause it doesn't have all the classes and
> > > fuctionality
> > > of a real DAS library. But it will later become a complete DAS
> library,
> > I
> > > expect ; ). You may call also DAS "initial phase", I don't know.
> > >
> > > Adriano Crestani
> > >
> > > On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> > > >
> > > > Hi Adriano
> > > >
> > > >    What's the difference between DAS C++ and DAS C++ lite ? Why we
> > would
> > > > need two ? I thought one DAS was already too much work :)
> > > >
> > > > --
> > > > Luciano Resende
> > > > http://people.apache.org/~lresende
> > > >
> > > > On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > I created a JIRA(
> https://issues.apache.org/jira/browse/TUSCANY-1140)
> > > to
> > > > > implement the DAS Lite Command classes that I described here:
> > > > >
> > http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
> > > > >
> > > > > Hey guys, I read this article
> > > > > https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you
> > > will
> > > > > like
> > > > > that, it tells a lot about how c++ sdo works ; )
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > I looked at the maven for netbeans page and it seems
> interesting,
> > > but
> > > > I
> > > > > > didn't have time to test it yet.
> > > > > >
> > > > > > Sorry Luciano, but what is a webApp skeleton? Could you give an
> > > > example?
> > > > > >
> > > > > >
> > > > > > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > > > >
> > > > > > > Except for the instructions related to NetBeans, most of these
> > > steps
> > > > > are
> > > > > > > defined on the following two links:
> > > > > > >    http://incubator.apache.org/tuscany/java-projects.html
> > > > > > > or
> > > > > > >    http://incubator.apache.org/tuscany/java_das_overview.html
> > > > > > >
> > > > > > > Probably would be better for you to review these links and
> > suggest
> > > > > > > enhancements, as most new users will probably have the same
> > issues
> > > > as
> > > > > > > you
> > > > > > > guys are having.
> > > > > > >
> > > > > > > The netBeans steps could probably also be appended to the
> > > > > > > java-projects.htmllink, together with the instructions on how
> to
> > > use
> > > > > > > Eclipse or IDEA. BTW,
> > > > > > > have you seen this :
> > > > > > >
> > > > > > >
> > > > >
> > > >
> > >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > > > > > >
> > > > > > >
> > > > > > > Looks like there is a plugin that does the creation of the
> > > netBeans
> > > > > > > project
> > > > > > > files from the pom
> > > > > > >
> > > > > > > mvn netbeans-freeform:generate-netbeans-project
> > > > > > >
> > > > > > >
> > > > > > > Then, for the webAPP, maybe it's easy if you provide a webApp
> > > > > > > skeleton, then people could only import the war file.
> > > > > > >
> > > > > > > Toughts ? Does the link help ?
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Luciano Resende
> > > > > > > http://people.apache.org/~lresende<
> > > > > http://people.apache.org/%7Elresende>
> > > > > > >
> > > > > > > On 2/16/07, Adriano Crestani <ad...@gmail.com>
> wrote:
> > > > > > > >
> > > > > > > > As me and Dannyel had some trouble on building and debugging
> > > this
> > > > > > > simple
> > > > > > > > read app using das java, I created this short howTo to help
> > > anyone
> > > > > > > else
> > > > > > > > that
> > > > > > > > is also having difficult to create a project on netbeans IDE
> > to
> > > > > debbug
> > > > > > > the
> > > > > > > > code.
> > > > > > > >
> > > > > > > > 1 - download subversion(
> > > > > http://subversion.tigris.org/project_packages.html
> > > > > > > > )
> > > > > > > > and unpack it
> > > > > > > >
> > > > > > > > 2 - download maven 2.0.4 (
> > http://maven.apache.org/download.html)
> > > > > and
> > > > > > > > unpack
> > > > > > > > it
> > > > > > > >
> > > > > > > > 3 - set maven/bin and subversion/bin in your SO path
> > > > > > > >
> > > > > > > > 4 - create a folder called, i. e. Tuscany, and download the
> > java
> > > > > > > source
> > > > > > > > executing the following commands:
> > > > > > > >
> > > > > > > > cd tuscany
> > > > > > > >
> > > > > > > > svn co
> https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > > > > > >
> > > > > > > > It will probably ask you if you accept the secure
> connection,
> > > than
> > > > > > > allow
> > > > > > > > it.
> > > > > > > >
> > > > > > > > 5 - Now, download the dependencies:
> > > > > > > >
> > > > > > > > cd java/das
> > > > > > > >
> > > > > > > > mvn
> > > > > > > >
> > > > > > > > The dependencies should be downloaded.  Let us know if you
> get
> > > any
> > > > > > > build
> > > > > > > > error on this part.
> > > > > > > >
> > > > > > > > 6 - Run Netbeans and select File >> New Project.... Select
> > > > "General"
> > > > > > > on
> > > > > > > > categories and then "Java Project with Existing Sources"
> then
> > > > click
> > > > > on
> > > > > > > > next
> > > > > > > >
> > > > > > > > 7 - Give a name to your project, i.e. "DAS", select its
> folder
> > > and
> > > > > > > click
> > > > > > > > on
> > > > > > > > next.
> > > > > > > >
> > > > > > > > 8 - Click on the first button "Add Folder..." and select the
> > > > > following
> > > > > > > > folders:
> > > > > > > >
> > > > > > > > Tuscany\java\das\rdb\src\main\java
> > > > > > > >
> > > > > > > > Tuscany\java\das\rdb\target\sdo-source
> > > > > > > >
> > > > > > > > Click on "Finish"
> > > > > > > >
> > > > > > > > 9 - Unpack the file
> > > > Tuscany\java\das\distribution\binary\target\das-
> > > > > > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > > > > > >
> > > > > > > > 10 - Right click on DAS project and select properties. Then
> > > select
> > > > > > > > libraries
> > > > > > > > and click on "Add JAR/Folder". Select all the files the
> folder
> > > > > > > > Lib\tuscany-
> > > > > > > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > > > > > > >
> > > > > > > > 11 - Again select File >> New Project... select "Web" on
> > > > categories
> > > > > > > and
> > > > > > > > "Web
> > > > > > > > Application" then click on next.
> > > > > > > >
> > > > > > > > 12 - Give a name to your project, i.e. SimpleReadApp, select
> > its
> > > > > > > folder
> > > > > > > > and
> > > > > > > > click on finish.
> > > > > > > >
> > > > > > > > 13 - Right click on you SimpleReadApp project and select New
> > >>
> > > > > > > Servlet.
> > > > > > > > Give a name to your servlet, i.e. CommandServlet and click
> on
> > > > > finish.
> > > > > > > A
> > > > > > > > new
> > > > > > > > .java file will be created in SimpleReadApp's Source
> Packages,
> > > > open
> > > > > it
> > > > > > > and
> > > > > > > > copy the CommandServlet class code in it.
> > > > > > > >
> > > > > > > > 14 - Right click on you SimpleReadApp project and select
> > > > properties.
> > > > > > > Then
> > > > > > > > select libraries and click on "Add JAR/Folder". Select the
> > file
> > > > > > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that
> resides
> > > > inside
> > > > > > > the
> > > > > > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click
> > on
> > > > > > > "Open".
> > > > > > > >
> > > > > > > > 15 - On the same window click on "Add Project...", select
> the
> > > DAS
> > > > > > > project
> > > > > > > > folder and click on open.
> > > > > > > >
> > > > > > > > Now you already have what is necessary to run and debug the
> > > code.
> > > > > > > Don't
> > > > > > > > forget to do the adjustments for your dbms:
> > > > > > > >
> > > > > > > >   - set the jdbc jar file
> > > > > > > >
> > > > > > > >   - modify the sql statement according to your dbms pl/sql
> > > > > > > >
> > > > > > > >   - modify the in getConnection method  the jdbc driver
> class
> > > > path,
> > > > > > > the
> > > > > > > > database path, user and password
> > > > > > > >
> > > > > > > >   - create in your database having an table called "ITEM"
> that
> > > has
> > > > > an
> > > > > > > > integer attribute called "ID". You must also insert at least
> > an
> > > > row
> > > > > in
> > > > > > > > this
> > > > > > > > table.
> > > > > > > >
> > > > > > > > I expect you to debug this simple read app and see for
> > > yourselves
> > > > > > > which
> > > > > > > > classes and methods are needed to implement the simple read
> > app.
> > > > > Then
> > > > > > > pick
> > > > > > > > the classes you want to implement and create a JIRA for it ;
> )
> > > > > > > >
> > > > > > > > Adriano Crestani
> > > > > > > >
> > > > > > > >
> > > > > > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > Good ideia.... I´ll do it.
> > > > > > > > >
> > > > > > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com>
> > > wrote:
> > > > > > > > > >
> > > > > > > > > > I have an idea to make it more independent. Each one
> that
> > > > wants
> > > > > to
> > > > > > >
> > > > > > > > help
> > > > > > > > > to
> > > > > > > > > > implement this simple app, evaluate which class is
> > intended
> > > to
> > > > > > > > implement
> > > > > > > > > > and
> > > > > > > > > > create a new JIRA for it. In this new JIRA should be
> > > described
> > > > > the
> > > > > > >
> > > > > > > > > classes
> > > > > > > > > > and their methods that will be implemented. This way if
> > > > someone
> > > > > > > finish
> > > > > > > > > to
> > > > > > > > > > implement certain classes, he will be able to choose
> > another
> > > > > > > classes
> > > > > > > > to
> > > > > > > > > > implement, instead of waiting for others to finish their
> > > > > classes.
> > > > > > > I
> > > > > > > > > think
> > > > > > > > > > this way we may speed up the das c++ coding.
> > > > > > > > > >
> > > > > > > > > > Please, if a new JIRA is created report it here in this
> > > > thread.
> > > > > > > > > >
> > > > > > > > > > Adriano Crestani
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Okay Adriano.... I will try to understand the simple
> > > > > application
> > > > > > >
> > > > > > > > that
> > > > > > > > > > > you´ve
> > > > > > > > > > > posted, step by step, and after that I will choose
> some
> > > > useful
> > > > > > > > classes
> > > > > > > > > > as
> > > > > > > > > > > well as their essentials methods to run that
> application
> > > in
> > > > > C++.
> > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Douglas S. Leite
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Adriano Crestani <
> adrianocrestani@gmail.com>
> > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Yes Luciano, but I wasn't sure if there would be any
> > > > problem
> > > > > > > if
> > > > > > > > the
> > > > > > > > > > > config
> > > > > > > > > > > > classes wouldn't be included. We will try to run it
> > > > without
> > > > > > > the
> > > > > > > > > config
> > > > > > > > > > > > classes though.
> > > > > > > > > > > >
> > > > > > > > > > > > Douglas, as I had assigned the config classes to you
> > > just
> > > > > pick
> > > > > > > > some
> > > > > > > > > > > > classes
> > > > > > > > > > > > from those I've assigned to the others. Or if you
> have
> > > > > another
> > > > > > > > > > > suggestion
> > > > > > > > > > > > in
> > > > > > > > > > > > what you could be useful just let us know.
> > > > > > > > > > > >
> > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com >
> > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > I'd agree with Kevin's suggestion, for a simple
> C++
> > > > sample
> > > > > > > > > > application
> > > > > > > > > > > > > that
> > > > > > > > > > > > > only performs a simple read, you shouldn't need
> the
> > > > config
> > > > > > > > > classes,
> > > > > > > > > > > try
> > > > > > > > > > > > to
> > > > > > > > > > > > > do in C++ something simple as the java sample you
> > just
> > > > > > > posted
> > > > > > > > > here.
> > > > > > > > > > > > >
> > > > > > > > > > > > > As for downloads, you only need to download the
> DAS
> > > > > > > > distribution,
> > > > > > > > > > that
> > > > > > > > > > > > > will
> > > > > > > > > > > > > contain all the SDO and other dependencies inside
> > the
> > > > zip.
> > > > > > > For
> > > > > > > > the
> > > > > > > > > > new
> > > > > > > > > > > > > people, I'd recommend using the stable M2
> > > distributions,
> > > > > > > > although
> > > > > > > > > I
> > > > > > > > > > > > think
> > > > > > > > > > > > > SDO and DAS trunk code are stable and compiling
> > fine.
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Luciano Resende
> > > > > > > > > > > > > http://people.apache.org/~lresende
> > > > > > > <http://people.apache.org/%7Elresende>
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > adrianocrestani@gmail.com>
> > > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > A correction, there is need to download the das
> > > also,
> > > > > not
> > > > > > > only
> > > > > > > > > the
> > > > > > > > > > > sdo
> > > > > > > > > > > > > > .jar:
> > > > > > > > > > > > > >
> > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > > adrianocrestani@gmail.com>
> > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > > adrianocrestani@gmail.com
> > > > > >
> > > > > > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look
> > > likes
> > > > > the
> > > > > > > > first
> > > > > > > > > > code
> > > > > > > > > > > I
> > > > > > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > On 2/8/07, Kevin Williams <
> kevincbw@qwest.net
> > >
> > > > > wrote:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Your focus should probably be on the APIs
> > your
> > > > DAS
> > > > > > > will
> > > > > > > > > > > provide
> > > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > user
> > > > > > > > > > > > > > > > > whether that is from a servlet or some
> other
> > > > > > > > caller.  Here
> > > > > > > > > > are
> > > > > > > > > > > > the
> > > > > > > > > > > > > > > > > Java
> > > > > > > > > > > > > > > > > DAS apis from the simplest possible read
> in
> > > the
> > > > > test
> > > > > > > > > suite:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >         /**
> > > > > > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > > > > > >          */
> > > > > > > > > > > > > > > > >         public void testReadSingle()
> throws
> > > > > > > Exception {
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >             // Create and initialize
> command
> > > to
> > > > > read
> > > > > > > > > > customers
> > > > > > > > > > > > > > > > >             DAS das =
> DAS.FACTORY.createDAS
> > > > > > > > > > (getConnection());
> > > > > > > > > > > > > > > > >             Command readCustomers =
> > > > > > > das.createCommand
> > > > > > > > > > ("select
> > > > > > > > > > > *
> > > > > > > > > > > > > from
> > > > > > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >             // Read
> > > > > > > > > > > > > > > > >             DataObject root =
> > > > > > > readCustomers.executeQuery
> > > > > > > > > ();
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > > > > > >         }
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Notice that this example also does not
> allow
> > > > > > > > parameterized
> > > > > > > > > > > > > > queries.  I
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > would make this simplifying assumption to
> > get
> > > > > > > something
> > > > > > > > up
> > > > > > > > > > and
> > > > > > > > > > > > > > > > > running.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > I cannot help with the C++ equivalent of
> > JDBC
> > > > > > > Connection
> > > > > > > > > but
> > > > > > > > > > I
> > > > > > > > > > > > am
> > > > > > > > > > > > > > sure
> > > > > > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > > Kevin
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > > 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.Connectionconn,
> > > > > > > > > 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 <
> > > kevincbw@qwest.net>
> > > > > > > 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:
> > > > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Luciano Resende
> > http://people.apache.org/~lresende
> >
>



-- 
Luciano Resende
http://people.apache.org/~lresende

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
Sorry guys, the sdo article url I gave is wrong, the correctly url is:
http://www-128.ibm.com/developerworks/webservices/library/ws-sdo-api/

Adriano Crestani

On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Thanks for the clarification. Makes sense now.
>
> On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > I gave this name just cause it doesn't have all the classes and
> > fuctionality
> > of a real DAS library. But it will later become a complete DAS library,
> I
> > expect ; ). You may call also DAS "initial phase", I don't know.
> >
> > Adriano Crestani
> >
> > On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > Hi Adriano
> > >
> > >    What's the difference between DAS C++ and DAS C++ lite ? Why we
> would
> > > need two ? I thought one DAS was already too much work :)
> > >
> > > --
> > > Luciano Resende
> > > http://people.apache.org/~lresende
> > >
> > > On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140)
> > to
> > > > implement the DAS Lite Command classes that I described here:
> > > >
> http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
> > > >
> > > > Hey guys, I read this article
> > > > https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you
> > will
> > > > like
> > > > that, it tells a lot about how c++ sdo works ; )
> > > >
> > > > Adriano Crestani
> > > >
> > > > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > I looked at the maven for netbeans page and it seems interesting,
> > but
> > > I
> > > > > didn't have time to test it yet.
> > > > >
> > > > > Sorry Luciano, but what is a webApp skeleton? Could you give an
> > > example?
> > > > >
> > > > >
> > > > > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > > >
> > > > > > Except for the instructions related to NetBeans, most of these
> > steps
> > > > are
> > > > > > defined on the following two links:
> > > > > >    http://incubator.apache.org/tuscany/java-projects.html
> > > > > > or
> > > > > >    http://incubator.apache.org/tuscany/java_das_overview.html
> > > > > >
> > > > > > Probably would be better for you to review these links and
> suggest
> > > > > > enhancements, as most new users will probably have the same
> issues
> > > as
> > > > > > you
> > > > > > guys are having.
> > > > > >
> > > > > > The netBeans steps could probably also be appended to the
> > > > > > java-projects.htmllink, together with the instructions on how to
> > use
> > > > > > Eclipse or IDEA. BTW,
> > > > > > have you seen this :
> > > > > >
> > > > > >
> > > >
> > >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > > > > >
> > > > > >
> > > > > > Looks like there is a plugin that does the creation of the
> > netBeans
> > > > > > project
> > > > > > files from the pom
> > > > > >
> > > > > > mvn netbeans-freeform:generate-netbeans-project
> > > > > >
> > > > > >
> > > > > > Then, for the webAPP, maybe it's easy if you provide a webApp
> > > > > > skeleton, then people could only import the war file.
> > > > > >
> > > > > > Toughts ? Does the link help ?
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Luciano Resende
> > > > > > http://people.apache.org/~lresende<
> > > > http://people.apache.org/%7Elresende>
> > > > > >
> > > > > > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > As me and Dannyel had some trouble on building and debugging
> > this
> > > > > > simple
> > > > > > > read app using das java, I created this short howTo to help
> > anyone
> > > > > > else
> > > > > > > that
> > > > > > > is also having difficult to create a project on netbeans IDE
> to
> > > > debbug
> > > > > > the
> > > > > > > code.
> > > > > > >
> > > > > > > 1 - download subversion(
> > > > http://subversion.tigris.org/project_packages.html
> > > > > > > )
> > > > > > > and unpack it
> > > > > > >
> > > > > > > 2 - download maven 2.0.4 (
> http://maven.apache.org/download.html)
> > > > and
> > > > > > > unpack
> > > > > > > it
> > > > > > >
> > > > > > > 3 - set maven/bin and subversion/bin in your SO path
> > > > > > >
> > > > > > > 4 - create a folder called, i. e. Tuscany, and download the
> java
> > > > > > source
> > > > > > > executing the following commands:
> > > > > > >
> > > > > > > cd tuscany
> > > > > > >
> > > > > > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > > > > >
> > > > > > > It will probably ask you if you accept the secure connection,
> > than
> > > > > > allow
> > > > > > > it.
> > > > > > >
> > > > > > > 5 - Now, download the dependencies:
> > > > > > >
> > > > > > > cd java/das
> > > > > > >
> > > > > > > mvn
> > > > > > >
> > > > > > > The dependencies should be downloaded.  Let us know if you get
> > any
> > > > > > build
> > > > > > > error on this part.
> > > > > > >
> > > > > > > 6 - Run Netbeans and select File >> New Project.... Select
> > > "General"
> > > > > > on
> > > > > > > categories and then "Java Project with Existing Sources" then
> > > click
> > > > on
> > > > > > > next
> > > > > > >
> > > > > > > 7 - Give a name to your project, i.e. "DAS", select its folder
> > and
> > > > > > click
> > > > > > > on
> > > > > > > next.
> > > > > > >
> > > > > > > 8 - Click on the first button "Add Folder..." and select the
> > > > following
> > > > > > > folders:
> > > > > > >
> > > > > > > Tuscany\java\das\rdb\src\main\java
> > > > > > >
> > > > > > > Tuscany\java\das\rdb\target\sdo-source
> > > > > > >
> > > > > > > Click on "Finish"
> > > > > > >
> > > > > > > 9 - Unpack the file
> > > Tuscany\java\das\distribution\binary\target\das-
> > > > > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > > > > >
> > > > > > > 10 - Right click on DAS project and select properties. Then
> > select
> > > > > > > libraries
> > > > > > > and click on "Add JAR/Folder". Select all the files the folder
> > > > > > > Lib\tuscany-
> > > > > > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > > > > > >
> > > > > > > 11 - Again select File >> New Project... select "Web" on
> > > categories
> > > > > > and
> > > > > > > "Web
> > > > > > > Application" then click on next.
> > > > > > >
> > > > > > > 12 - Give a name to your project, i.e. SimpleReadApp, select
> its
> > > > > > folder
> > > > > > > and
> > > > > > > click on finish.
> > > > > > >
> > > > > > > 13 - Right click on you SimpleReadApp project and select New
> >>
> > > > > > Servlet.
> > > > > > > Give a name to your servlet, i.e. CommandServlet and click on
> > > > finish.
> > > > > > A
> > > > > > > new
> > > > > > > .java file will be created in SimpleReadApp's Source Packages,
> > > open
> > > > it
> > > > > > and
> > > > > > > copy the CommandServlet class code in it.
> > > > > > >
> > > > > > > 14 - Right click on you SimpleReadApp project and select
> > > properties.
> > > > > > Then
> > > > > > > select libraries and click on "Add JAR/Folder". Select the
> file
> > > > > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides
> > > inside
> > > > > > the
> > > > > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click
> on
> > > > > > "Open".
> > > > > > >
> > > > > > > 15 - On the same window click on "Add Project...", select the
> > DAS
> > > > > > project
> > > > > > > folder and click on open.
> > > > > > >
> > > > > > > Now you already have what is necessary to run and debug the
> > code.
> > > > > > Don't
> > > > > > > forget to do the adjustments for your dbms:
> > > > > > >
> > > > > > >   - set the jdbc jar file
> > > > > > >
> > > > > > >   - modify the sql statement according to your dbms pl/sql
> > > > > > >
> > > > > > >   - modify the in getConnection method  the jdbc driver class
> > > path,
> > > > > > the
> > > > > > > database path, user and password
> > > > > > >
> > > > > > >   - create in your database having an table called "ITEM" that
> > has
> > > > an
> > > > > > > integer attribute called "ID". You must also insert at least
> an
> > > row
> > > > in
> > > > > > > this
> > > > > > > table.
> > > > > > >
> > > > > > > I expect you to debug this simple read app and see for
> > yourselves
> > > > > > which
> > > > > > > classes and methods are needed to implement the simple read
> app.
> > > > Then
> > > > > > pick
> > > > > > > the classes you want to implement and create a JIRA for it ; )
> > > > > > >
> > > > > > > Adriano Crestani
> > > > > > >
> > > > > > >
> > > > > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Good ideia.... I´ll do it.
> > > > > > > >
> > > > > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com>
> > wrote:
> > > > > > > > >
> > > > > > > > > I have an idea to make it more independent. Each one that
> > > wants
> > > > to
> > > > > >
> > > > > > > help
> > > > > > > > to
> > > > > > > > > implement this simple app, evaluate which class is
> intended
> > to
> > > > > > > implement
> > > > > > > > > and
> > > > > > > > > create a new JIRA for it. In this new JIRA should be
> > described
> > > > the
> > > > > >
> > > > > > > > classes
> > > > > > > > > and their methods that will be implemented. This way if
> > > someone
> > > > > > finish
> > > > > > > > to
> > > > > > > > > implement certain classes, he will be able to choose
> another
> > > > > > classes
> > > > > > > to
> > > > > > > > > implement, instead of waiting for others to finish their
> > > > classes.
> > > > > > I
> > > > > > > > think
> > > > > > > > > this way we may speed up the das c++ coding.
> > > > > > > > >
> > > > > > > > > Please, if a new JIRA is created report it here in this
> > > thread.
> > > > > > > > >
> > > > > > > > > Adriano Crestani
> > > > > > > > >
> > > > > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > > > >
> > > > > > > > > > Okay Adriano.... I will try to understand the simple
> > > > application
> > > > > >
> > > > > > > that
> > > > > > > > > > you´ve
> > > > > > > > > > posted, step by step, and after that I will choose some
> > > useful
> > > > > > > classes
> > > > > > > > > as
> > > > > > > > > > well as their essentials methods to run that application
> > in
> > > > C++.
> > > > > >
> > > > > > > > > >
> > > > > > > > > > Douglas S. Leite
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Yes Luciano, but I wasn't sure if there would be any
> > > problem
> > > > > > if
> > > > > > > the
> > > > > > > > > > config
> > > > > > > > > > > classes wouldn't be included. We will try to run it
> > > without
> > > > > > the
> > > > > > > > config
> > > > > > > > > > > classes though.
> > > > > > > > > > >
> > > > > > > > > > > Douglas, as I had assigned the config classes to you
> > just
> > > > pick
> > > > > > > some
> > > > > > > > > > > classes
> > > > > > > > > > > from those I've assigned to the others. Or if you have
> > > > another
> > > > > > > > > > suggestion
> > > > > > > > > > > in
> > > > > > > > > > > what you could be useful just let us know.
> > > > > > > > > > >
> > > > > > > > > > > Adriano Crestani
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com >
> > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > I'd agree with Kevin's suggestion, for a simple C++
> > > sample
> > > > > > > > > application
> > > > > > > > > > > > that
> > > > > > > > > > > > only performs a simple read, you shouldn't need the
> > > config
> > > > > > > > classes,
> > > > > > > > > > try
> > > > > > > > > > > to
> > > > > > > > > > > > do in C++ something simple as the java sample you
> just
> > > > > > posted
> > > > > > > > here.
> > > > > > > > > > > >
> > > > > > > > > > > > As for downloads, you only need to download the DAS
> > > > > > > distribution,
> > > > > > > > > that
> > > > > > > > > > > > will
> > > > > > > > > > > > contain all the SDO and other dependencies inside
> the
> > > zip.
> > > > > > For
> > > > > > > the
> > > > > > > > > new
> > > > > > > > > > > > people, I'd recommend using the stable M2
> > distributions,
> > > > > > > although
> > > > > > > > I
> > > > > > > > > > > think
> > > > > > > > > > > > SDO and DAS trunk code are stable and compiling
> fine.
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Luciano Resende
> > > > > > > > > > > > http://people.apache.org/~lresende
> > > > > > <http://people.apache.org/%7Elresende>
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> adrianocrestani@gmail.com>
> > > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > A correction, there is need to download the das
> > also,
> > > > not
> > > > > > only
> > > > > > > > the
> > > > > > > > > > sdo
> > > > > > > > > > > > > .jar:
> > > > > > > > > > > > >
> > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > adrianocrestani@gmail.com>
> > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > > adrianocrestani@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look
> > likes
> > > > the
> > > > > > > first
> > > > > > > > > code
> > > > > > > > > > I
> > > > > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > On 2/8/07, Kevin Williams < kevincbw@qwest.net
> >
> > > > wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Your focus should probably be on the APIs
> your
> > > DAS
> > > > > > will
> > > > > > > > > > provide
> > > > > > > > > > > > the
> > > > > > > > > > > > > > > > user
> > > > > > > > > > > > > > > > whether that is from a servlet or some other
> > > > > > > caller.  Here
> > > > > > > > > are
> > > > > > > > > > > the
> > > > > > > > > > > > > > > > Java
> > > > > > > > > > > > > > > > DAS apis from the simplest possible read in
> > the
> > > > test
> > > > > > > > suite:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >         /**
> > > > > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > > > > >          */
> > > > > > > > > > > > > > > >         public void testReadSingle() throws
> > > > > > Exception {
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >             // Create and initialize command
> > to
> > > > read
> > > > > > > > > customers
> > > > > > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > > > > > (getConnection());
> > > > > > > > > > > > > > > >             Command readCustomers =
> > > > > > das.createCommand
> > > > > > > > > ("select
> > > > > > > > > > *
> > > > > > > > > > > > from
> > > > > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >             // Read
> > > > > > > > > > > > > > > >             DataObject root =
> > > > > > readCustomers.executeQuery
> > > > > > > > ();
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > > > > >         }
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Notice that this example also does not allow
> > > > > > > parameterized
> > > > > > > > > > > > > queries.  I
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > would make this simplifying assumption to
> get
> > > > > > something
> > > > > > > up
> > > > > > > > > and
> > > > > > > > > > > > > > > > running.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > I cannot help with the C++ equivalent of
> JDBC
> > > > > > Connection
> > > > > > > > but
> > > > > > > > > I
> > > > > > > > > > > am
> > > > > > > > > > > > > sure
> > > > > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > > Kevin
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > > 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.Connectionconn,
> > > > > > > > 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 <
> > kevincbw@qwest.net>
> > > > > > 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:
> > > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
Thanks for the clarification. Makes sense now.

On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> I gave this name just cause it doesn't have all the classes and
> fuctionality
> of a real DAS library. But it will later become a complete DAS library, I
> expect ; ). You may call also DAS "initial phase", I don't know.
>
> Adriano Crestani
>
> On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Hi Adriano
> >
> >    What's the difference between DAS C++ and DAS C++ lite ? Why we would
> > need two ? I thought one DAS was already too much work :)
> >
> > --
> > Luciano Resende
> > http://people.apache.org/~lresende
> >
> > On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140)
> to
> > > implement the DAS Lite Command classes that I described here:
> > > http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
> > >
> > > Hey guys, I read this article
> > > https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you
> will
> > > like
> > > that, it tells a lot about how c++ sdo works ; )
> > >
> > > Adriano Crestani
> > >
> > > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > I looked at the maven for netbeans page and it seems interesting,
> but
> > I
> > > > didn't have time to test it yet.
> > > >
> > > > Sorry Luciano, but what is a webApp skeleton? Could you give an
> > example?
> > > >
> > > >
> > > > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > >
> > > > > Except for the instructions related to NetBeans, most of these
> steps
> > > are
> > > > > defined on the following two links:
> > > > >    http://incubator.apache.org/tuscany/java-projects.html
> > > > > or
> > > > >    http://incubator.apache.org/tuscany/java_das_overview.html
> > > > >
> > > > > Probably would be better for you to review these links and suggest
> > > > > enhancements, as most new users will probably have the same issues
> > as
> > > > > you
> > > > > guys are having.
> > > > >
> > > > > The netBeans steps could probably also be appended to the
> > > > > java-projects.htmllink, together with the instructions on how to
> use
> > > > > Eclipse or IDEA. BTW,
> > > > > have you seen this :
> > > > >
> > > > >
> > >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > > > >
> > > > >
> > > > > Looks like there is a plugin that does the creation of the
> netBeans
> > > > > project
> > > > > files from the pom
> > > > >
> > > > > mvn netbeans-freeform:generate-netbeans-project
> > > > >
> > > > >
> > > > > Then, for the webAPP, maybe it's easy if you provide a webApp
> > > > > skeleton, then people could only import the war file.
> > > > >
> > > > > Toughts ? Does the link help ?
> > > > >
> > > > >
> > > > > --
> > > > > Luciano Resende
> > > > > http://people.apache.org/~lresende<
> > > http://people.apache.org/%7Elresende>
> > > > >
> > > > > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > As me and Dannyel had some trouble on building and debugging
> this
> > > > > simple
> > > > > > read app using das java, I created this short howTo to help
> anyone
> > > > > else
> > > > > > that
> > > > > > is also having difficult to create a project on netbeans IDE to
> > > debbug
> > > > > the
> > > > > > code.
> > > > > >
> > > > > > 1 - download subversion(
> > > http://subversion.tigris.org/project_packages.html
> > > > > > )
> > > > > > and unpack it
> > > > > >
> > > > > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html)
> > > and
> > > > > > unpack
> > > > > > it
> > > > > >
> > > > > > 3 - set maven/bin and subversion/bin in your SO path
> > > > > >
> > > > > > 4 - create a folder called, i. e. Tuscany, and download the java
> > > > > source
> > > > > > executing the following commands:
> > > > > >
> > > > > > cd tuscany
> > > > > >
> > > > > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > > > >
> > > > > > It will probably ask you if you accept the secure connection,
> than
> > > > > allow
> > > > > > it.
> > > > > >
> > > > > > 5 - Now, download the dependencies:
> > > > > >
> > > > > > cd java/das
> > > > > >
> > > > > > mvn
> > > > > >
> > > > > > The dependencies should be downloaded.  Let us know if you get
> any
> > > > > build
> > > > > > error on this part.
> > > > > >
> > > > > > 6 - Run Netbeans and select File >> New Project.... Select
> > "General"
> > > > > on
> > > > > > categories and then "Java Project with Existing Sources" then
> > click
> > > on
> > > > > > next
> > > > > >
> > > > > > 7 - Give a name to your project, i.e. "DAS", select its folder
> and
> > > > > click
> > > > > > on
> > > > > > next.
> > > > > >
> > > > > > 8 - Click on the first button "Add Folder..." and select the
> > > following
> > > > > > folders:
> > > > > >
> > > > > > Tuscany\java\das\rdb\src\main\java
> > > > > >
> > > > > > Tuscany\java\das\rdb\target\sdo-source
> > > > > >
> > > > > > Click on "Finish"
> > > > > >
> > > > > > 9 - Unpack the file
> > Tuscany\java\das\distribution\binary\target\das-
> > > > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > > > >
> > > > > > 10 - Right click on DAS project and select properties. Then
> select
> > > > > > libraries
> > > > > > and click on "Add JAR/Folder". Select all the files the folder
> > > > > > Lib\tuscany-
> > > > > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > > > > >
> > > > > > 11 - Again select File >> New Project... select "Web" on
> > categories
> > > > > and
> > > > > > "Web
> > > > > > Application" then click on next.
> > > > > >
> > > > > > 12 - Give a name to your project, i.e. SimpleReadApp, select its
> > > > > folder
> > > > > > and
> > > > > > click on finish.
> > > > > >
> > > > > > 13 - Right click on you SimpleReadApp project and select New >>
> > > > > Servlet.
> > > > > > Give a name to your servlet, i.e. CommandServlet and click on
> > > finish.
> > > > > A
> > > > > > new
> > > > > > .java file will be created in SimpleReadApp's Source Packages,
> > open
> > > it
> > > > > and
> > > > > > copy the CommandServlet class code in it.
> > > > > >
> > > > > > 14 - Right click on you SimpleReadApp project and select
> > properties.
> > > > > Then
> > > > > > select libraries and click on "Add JAR/Folder". Select the file
> > > > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides
> > inside
> > > > > the
> > > > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on
> > > > > "Open".
> > > > > >
> > > > > > 15 - On the same window click on "Add Project...", select the
> DAS
> > > > > project
> > > > > > folder and click on open.
> > > > > >
> > > > > > Now you already have what is necessary to run and debug the
> code.
> > > > > Don't
> > > > > > forget to do the adjustments for your dbms:
> > > > > >
> > > > > >   - set the jdbc jar file
> > > > > >
> > > > > >   - modify the sql statement according to your dbms pl/sql
> > > > > >
> > > > > >   - modify the in getConnection method  the jdbc driver class
> > path,
> > > > > the
> > > > > > database path, user and password
> > > > > >
> > > > > >   - create in your database having an table called "ITEM" that
> has
> > > an
> > > > > > integer attribute called "ID". You must also insert at least an
> > row
> > > in
> > > > > > this
> > > > > > table.
> > > > > >
> > > > > > I expect you to debug this simple read app and see for
> yourselves
> > > > > which
> > > > > > classes and methods are needed to implement the simple read app.
> > > Then
> > > > > pick
> > > > > > the classes you want to implement and create a JIRA for it ; )
> > > > > >
> > > > > > Adriano Crestani
> > > > > >
> > > > > >
> > > > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > >
> > > > > > > Good ideia.... I´ll do it.
> > > > > > >
> > > > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com>
> wrote:
> > > > > > > >
> > > > > > > > I have an idea to make it more independent. Each one that
> > wants
> > > to
> > > > >
> > > > > > help
> > > > > > > to
> > > > > > > > implement this simple app, evaluate which class is intended
> to
> > > > > > implement
> > > > > > > > and
> > > > > > > > create a new JIRA for it. In this new JIRA should be
> described
> > > the
> > > > >
> > > > > > > classes
> > > > > > > > and their methods that will be implemented. This way if
> > someone
> > > > > finish
> > > > > > > to
> > > > > > > > implement certain classes, he will be able to choose another
> > > > > classes
> > > > > > to
> > > > > > > > implement, instead of waiting for others to finish their
> > > classes.
> > > > > I
> > > > > > > think
> > > > > > > > this way we may speed up the das c++ coding.
> > > > > > > >
> > > > > > > > Please, if a new JIRA is created report it here in this
> > thread.
> > > > > > > >
> > > > > > > > Adriano Crestani
> > > > > > > >
> > > > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > > >
> > > > > > > > > Okay Adriano.... I will try to understand the simple
> > > application
> > > > >
> > > > > > that
> > > > > > > > > you´ve
> > > > > > > > > posted, step by step, and after that I will choose some
> > useful
> > > > > > classes
> > > > > > > > as
> > > > > > > > > well as their essentials methods to run that application
> in
> > > C++.
> > > > >
> > > > > > > > >
> > > > > > > > > Douglas S. Leite
> > > > > > > > >
> > > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > > wrote:
> > > > > > > > > >
> > > > > > > > > > Yes Luciano, but I wasn't sure if there would be any
> > problem
> > > > > if
> > > > > > the
> > > > > > > > > config
> > > > > > > > > > classes wouldn't be included. We will try to run it
> > without
> > > > > the
> > > > > > > config
> > > > > > > > > > classes though.
> > > > > > > > > >
> > > > > > > > > > Douglas, as I had assigned the config classes to you
> just
> > > pick
> > > > > > some
> > > > > > > > > > classes
> > > > > > > > > > from those I've assigned to the others. Or if you have
> > > another
> > > > > > > > > suggestion
> > > > > > > > > > in
> > > > > > > > > > what you could be useful just let us know.
> > > > > > > > > >
> > > > > > > > > > Adriano Crestani
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com >
> wrote:
> > > > > > > > > > >
> > > > > > > > > > > I'd agree with Kevin's suggestion, for a simple C++
> > sample
> > > > > > > > application
> > > > > > > > > > > that
> > > > > > > > > > > only performs a simple read, you shouldn't need the
> > config
> > > > > > > classes,
> > > > > > > > > try
> > > > > > > > > > to
> > > > > > > > > > > do in C++ something simple as the java sample you just
> > > > > posted
> > > > > > > here.
> > > > > > > > > > >
> > > > > > > > > > > As for downloads, you only need to download the DAS
> > > > > > distribution,
> > > > > > > > that
> > > > > > > > > > > will
> > > > > > > > > > > contain all the SDO and other dependencies inside the
> > zip.
> > > > > For
> > > > > > the
> > > > > > > > new
> > > > > > > > > > > people, I'd recommend using the stable M2
> distributions,
> > > > > > although
> > > > > > > I
> > > > > > > > > > think
> > > > > > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Luciano Resende
> > > > > > > > > > > http://people.apache.org/~lresende
> > > > > <http://people.apache.org/%7Elresende>
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> > > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > A correction, there is need to download the das
> also,
> > > not
> > > > > only
> > > > > > > the
> > > > > > > > > sdo
> > > > > > > > > > > > .jar:
> > > > > > > > > > > >
> http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > adrianocrestani@gmail.com>
> > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> > adrianocrestani@gmail.com
> > > >
> > > > > > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look
> likes
> > > the
> > > > > > first
> > > > > > > > code
> > > > > > > > > I
> > > > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > On 2/8/07, Kevin Williams < kevincbw@qwest.net>
> > > wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Your focus should probably be on the APIs your
> > DAS
> > > > > will
> > > > > > > > > provide
> > > > > > > > > > > the
> > > > > > > > > > > > > > > user
> > > > > > > > > > > > > > > whether that is from a servlet or some other
> > > > > > caller.  Here
> > > > > > > > are
> > > > > > > > > > the
> > > > > > > > > > > > > > > Java
> > > > > > > > > > > > > > > DAS apis from the simplest possible read in
> the
> > > test
> > > > > > > suite:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >         /**
> > > > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > > > >          */
> > > > > > > > > > > > > > >         public void testReadSingle() throws
> > > > > Exception {
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >             // Create and initialize command
> to
> > > read
> > > > > > > > customers
> > > > > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > > > > (getConnection());
> > > > > > > > > > > > > > >             Command readCustomers =
> > > > > das.createCommand
> > > > > > > > ("select
> > > > > > > > > *
> > > > > > > > > > > from
> > > > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >             // Read
> > > > > > > > > > > > > > >             DataObject root =
> > > > > readCustomers.executeQuery
> > > > > > > ();
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > > > >         }
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Notice that this example also does not allow
> > > > > > parameterized
> > > > > > > > > > > > queries.  I
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > would make this simplifying assumption to get
> > > > > something
> > > > > > up
> > > > > > > > and
> > > > > > > > > > > > > > > running.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> > > > > Connection
> > > > > > > but
> > > > > > > > I
> > > > > > > > > > am
> > > > > > > > > > > > sure
> > > > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > --
> > > > > > > > > > > > > > > Kevin
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > > > 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.Connectionconn,
> > > > > > > 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 <
> kevincbw@qwest.net>
> > > > > 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:
> > > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
>



-- 
Luciano Resende
http://people.apache.org/~lresende

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
I gave this name just cause it doesn't have all the classes and fuctionality
of a real DAS library. But it will later become a complete DAS library, I
expect ; ). You may call also DAS "initial phase", I don't know.

Adriano Crestani

On 2/27/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Hi Adriano
>
>    What's the difference between DAS C++ and DAS C++ lite ? Why we would
> need two ? I thought one DAS was already too much work :)
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
>
> On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140) to
> > implement the DAS Lite Command classes that I described here:
> > http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
> >
> > Hey guys, I read this article
> > https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you will
> > like
> > that, it tells a lot about how c++ sdo works ; )
> >
> > Adriano Crestani
> >
> > On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > I looked at the maven for netbeans page and it seems interesting, but
> I
> > > didn't have time to test it yet.
> > >
> > > Sorry Luciano, but what is a webApp skeleton? Could you give an
> example?
> > >
> > >
> > > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > > >
> > > > Except for the instructions related to NetBeans, most of these steps
> > are
> > > > defined on the following two links:
> > > >    http://incubator.apache.org/tuscany/java-projects.html
> > > > or
> > > >    http://incubator.apache.org/tuscany/java_das_overview.html
> > > >
> > > > Probably would be better for you to review these links and suggest
> > > > enhancements, as most new users will probably have the same issues
> as
> > > > you
> > > > guys are having.
> > > >
> > > > The netBeans steps could probably also be appended to the
> > > > java-projects.htmllink, together with the instructions on how to use
> > > > Eclipse or IDEA. BTW,
> > > > have you seen this :
> > > >
> > > >
> >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > > >
> > > >
> > > > Looks like there is a plugin that does the creation of the netBeans
> > > > project
> > > > files from the pom
> > > >
> > > > mvn netbeans-freeform:generate-netbeans-project
> > > >
> > > >
> > > > Then, for the webAPP, maybe it's easy if you provide a webApp
> > > > skeleton, then people could only import the war file.
> > > >
> > > > Toughts ? Does the link help ?
> > > >
> > > >
> > > > --
> > > > Luciano Resende
> > > > http://people.apache.org/~lresende<
> > http://people.apache.org/%7Elresende>
> > > >
> > > > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > As me and Dannyel had some trouble on building and debugging this
> > > > simple
> > > > > read app using das java, I created this short howTo to help anyone
> > > > else
> > > > > that
> > > > > is also having difficult to create a project on netbeans IDE to
> > debbug
> > > > the
> > > > > code.
> > > > >
> > > > > 1 - download subversion(
> > http://subversion.tigris.org/project_packages.html
> > > > > )
> > > > > and unpack it
> > > > >
> > > > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html )
> > and
> > > > > unpack
> > > > > it
> > > > >
> > > > > 3 - set maven/bin and subversion/bin in your SO path
> > > > >
> > > > > 4 - create a folder called, i. e. Tuscany, and download the java
> > > > source
> > > > > executing the following commands:
> > > > >
> > > > > cd tuscany
> > > > >
> > > > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > > >
> > > > > It will probably ask you if you accept the secure connection, than
> > > > allow
> > > > > it.
> > > > >
> > > > > 5 - Now, download the dependencies:
> > > > >
> > > > > cd java/das
> > > > >
> > > > > mvn
> > > > >
> > > > > The dependencies should be downloaded.  Let us know if you get any
> > > > build
> > > > > error on this part.
> > > > >
> > > > > 6 - Run Netbeans and select File >> New Project.... Select
> "General"
> > > > on
> > > > > categories and then "Java Project with Existing Sources" then
> click
> > on
> > > > > next
> > > > >
> > > > > 7 - Give a name to your project, i.e. "DAS", select its folder and
> > > > click
> > > > > on
> > > > > next.
> > > > >
> > > > > 8 - Click on the first button "Add Folder..." and select the
> > following
> > > > > folders:
> > > > >
> > > > > Tuscany\java\das\rdb\src\main\java
> > > > >
> > > > > Tuscany\java\das\rdb\target\sdo-source
> > > > >
> > > > > Click on "Finish"
> > > > >
> > > > > 9 - Unpack the file
> Tuscany\java\das\distribution\binary\target\das-
> > > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > > >
> > > > > 10 - Right click on DAS project and select properties. Then select
> > > > > libraries
> > > > > and click on "Add JAR/Folder". Select all the files the folder
> > > > > Lib\tuscany-
> > > > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > > > >
> > > > > 11 - Again select File >> New Project... select "Web" on
> categories
> > > > and
> > > > > "Web
> > > > > Application" then click on next.
> > > > >
> > > > > 12 - Give a name to your project, i.e. SimpleReadApp, select its
> > > > folder
> > > > > and
> > > > > click on finish.
> > > > >
> > > > > 13 - Right click on you SimpleReadApp project and select New >>
> > > > Servlet.
> > > > > Give a name to your servlet, i.e. CommandServlet and click on
> > finish.
> > > > A
> > > > > new
> > > > > .java file will be created in SimpleReadApp's Source Packages,
> open
> > it
> > > > and
> > > > > copy the CommandServlet class code in it.
> > > > >
> > > > > 14 - Right click on you SimpleReadApp project and select
> properties.
> > > > Then
> > > > > select libraries and click on "Add JAR/Folder". Select the file
> > > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides
> inside
> > > > the
> > > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on
> > > > "Open".
> > > > >
> > > > > 15 - On the same window click on "Add Project...", select the DAS
> > > > project
> > > > > folder and click on open.
> > > > >
> > > > > Now you already have what is necessary to run and debug the code.
> > > > Don't
> > > > > forget to do the adjustments for your dbms:
> > > > >
> > > > >   - set the jdbc jar file
> > > > >
> > > > >   - modify the sql statement according to your dbms pl/sql
> > > > >
> > > > >   - modify the in getConnection method  the jdbc driver class
> path,
> > > > the
> > > > > database path, user and password
> > > > >
> > > > >   - create in your database having an table called "ITEM" that has
> > an
> > > > > integer attribute called "ID". You must also insert at least an
> row
> > in
> > > > > this
> > > > > table.
> > > > >
> > > > > I expect you to debug this simple read app and see for yourselves
> > > > which
> > > > > classes and methods are needed to implement the simple read app.
> > Then
> > > > pick
> > > > > the classes you want to implement and create a JIRA for it ; )
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > >
> > > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > >
> > > > > > Good ideia.... I´ll do it.
> > > > > >
> > > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com> wrote:
> > > > > > >
> > > > > > > I have an idea to make it more independent. Each one that
> wants
> > to
> > > >
> > > > > help
> > > > > > to
> > > > > > > implement this simple app, evaluate which class is intended to
> > > > > implement
> > > > > > > and
> > > > > > > create a new JIRA for it. In this new JIRA should be described
> > the
> > > >
> > > > > > classes
> > > > > > > and their methods that will be implemented. This way if
> someone
> > > > finish
> > > > > > to
> > > > > > > implement certain classes, he will be able to choose another
> > > > classes
> > > > > to
> > > > > > > implement, instead of waiting for others to finish their
> > classes.
> > > > I
> > > > > > think
> > > > > > > this way we may speed up the das c++ coding.
> > > > > > >
> > > > > > > Please, if a new JIRA is created report it here in this
> thread.
> > > > > > >
> > > > > > > Adriano Crestani
> > > > > > >
> > > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Okay Adriano.... I will try to understand the simple
> > application
> > > >
> > > > > that
> > > > > > > > you´ve
> > > > > > > > posted, step by step, and after that I will choose some
> useful
> > > > > classes
> > > > > > > as
> > > > > > > > well as their essentials methods to run that application in
> > C++.
> > > >
> > > > > > > >
> > > > > > > > Douglas S. Leite
> > > > > > > >
> > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > wrote:
> > > > > > > > >
> > > > > > > > > Yes Luciano, but I wasn't sure if there would be any
> problem
> > > > if
> > > > > the
> > > > > > > > config
> > > > > > > > > classes wouldn't be included. We will try to run it
> without
> > > > the
> > > > > > config
> > > > > > > > > classes though.
> > > > > > > > >
> > > > > > > > > Douglas, as I had assigned the config classes to you just
> > pick
> > > > > some
> > > > > > > > > classes
> > > > > > > > > from those I've assigned to the others. Or if you have
> > another
> > > > > > > > suggestion
> > > > > > > > > in
> > > > > > > > > what you could be useful just let us know.
> > > > > > > > >
> > > > > > > > > Adriano Crestani
> > > > > > > > >
> > > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > > I'd agree with Kevin's suggestion, for a simple C++
> sample
> > > > > > > application
> > > > > > > > > > that
> > > > > > > > > > only performs a simple read, you shouldn't need the
> config
> > > > > > classes,
> > > > > > > > try
> > > > > > > > > to
> > > > > > > > > > do in C++ something simple as the java sample you just
> > > > posted
> > > > > > here.
> > > > > > > > > >
> > > > > > > > > > As for downloads, you only need to download the DAS
> > > > > distribution,
> > > > > > > that
> > > > > > > > > > will
> > > > > > > > > > contain all the SDO and other dependencies inside the
> zip.
> > > > For
> > > > > the
> > > > > > > new
> > > > > > > > > > people, I'd recommend using the stable M2 distributions,
> > > > > although
> > > > > > I
> > > > > > > > > think
> > > > > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Luciano Resende
> > > > > > > > > > http://people.apache.org/~lresende
> > > > <http://people.apache.org/%7Elresende>
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Adriano Crestani <adrianocrestani@gmail.com >
> > > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > A correction, there is need to download the das also,
> > not
> > > > only
> > > > > > the
> > > > > > > > sdo
> > > > > > > > > > > .jar:
> > > > > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Adriano Crestani <
> adrianocrestani@gmail.com>
> > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Adriano Crestani <
> adrianocrestani@gmail.com
> > >
> > > > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes
> > the
> > > > > first
> > > > > > > code
> > > > > > > > I
> > > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > > >
> > > > > > > > > > > > > On 2/8/07, Kevin Williams < kevincbw@qwest.net>
> > wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Your focus should probably be on the APIs your
> DAS
> > > > will
> > > > > > > > provide
> > > > > > > > > > the
> > > > > > > > > > > > > > user
> > > > > > > > > > > > > > whether that is from a servlet or some other
> > > > > caller.  Here
> > > > > > > are
> > > > > > > > > the
> > > > > > > > > > > > > > Java
> > > > > > > > > > > > > > DAS apis from the simplest possible read in the
> > test
> > > > > > suite:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >         /**
> > > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > > >          */
> > > > > > > > > > > > > >         public void testReadSingle() throws
> > > > Exception {
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >             // Create and initialize command to
> > read
> > > > > > > customers
> > > > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > > > (getConnection());
> > > > > > > > > > > > > >             Command readCustomers =
> > > > das.createCommand
> > > > > > > ("select
> > > > > > > > *
> > > > > > > > > > from
> > > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >             // Read
> > > > > > > > > > > > > >             DataObject root =
> > > > readCustomers.executeQuery
> > > > > > ();
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > > >         }
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Notice that this example also does not allow
> > > > > parameterized
> > > > > > > > > > > queries.  I
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > would make this simplifying assumption to get
> > > > something
> > > > > up
> > > > > > > and
> > > > > > > > > > > > > > running.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> > > > Connection
> > > > > > but
> > > > > > > I
> > > > > > > > > am
> > > > > > > > > > > sure
> > > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > --
> > > > > > > > > > > > > > Kevin
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > > >
> > > > > > > > > > > > > > > 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.Connectionconn,
> > > > > > 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 <ke...@qwest.net>
> > > > 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:
> > > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > >>
> > > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > >
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
Hi Adriano

   What's the difference between DAS C++ and DAS C++ lite ? Why we would
need two ? I thought one DAS was already too much work :)

-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/26/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140) to
> implement the DAS Lite Command classes that I described here:
> http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093
>
> Hey guys, I read this article
> https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you will
> like
> that, it tells a lot about how c++ sdo works ; )
>
> Adriano Crestani
>
> On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > I looked at the maven for netbeans page and it seems interesting, but I
> > didn't have time to test it yet.
> >
> > Sorry Luciano, but what is a webApp skeleton? Could you give an example?
> >
> >
> > On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > Except for the instructions related to NetBeans, most of these steps
> are
> > > defined on the following two links:
> > >    http://incubator.apache.org/tuscany/java-projects.html
> > > or
> > >    http://incubator.apache.org/tuscany/java_das_overview.html
> > >
> > > Probably would be better for you to review these links and suggest
> > > enhancements, as most new users will probably have the same issues as
> > > you
> > > guys are having.
> > >
> > > The netBeans steps could probably also be appended to the
> > > java-projects.htmllink, together with the instructions on how to use
> > > Eclipse or IDEA. BTW,
> > > have you seen this :
> > >
> > >
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> > >
> > >
> > > Looks like there is a plugin that does the creation of the netBeans
> > > project
> > > files from the pom
> > >
> > > mvn netbeans-freeform:generate-netbeans-project
> > >
> > >
> > > Then, for the webAPP, maybe it's easy if you provide a webApp
> > > skeleton, then people could only import the war file.
> > >
> > > Toughts ? Does the link help ?
> > >
> > >
> > > --
> > > Luciano Resende
> > > http://people.apache.org/~lresende<
> http://people.apache.org/%7Elresende>
> > >
> > > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > As me and Dannyel had some trouble on building and debugging this
> > > simple
> > > > read app using das java, I created this short howTo to help anyone
> > > else
> > > > that
> > > > is also having difficult to create a project on netbeans IDE to
> debbug
> > > the
> > > > code.
> > > >
> > > > 1 - download subversion(
> http://subversion.tigris.org/project_packages.html
> > > > )
> > > > and unpack it
> > > >
> > > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html )
> and
> > > > unpack
> > > > it
> > > >
> > > > 3 - set maven/bin and subversion/bin in your SO path
> > > >
> > > > 4 - create a folder called, i. e. Tuscany, and download the java
> > > source
> > > > executing the following commands:
> > > >
> > > > cd tuscany
> > > >
> > > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > > >
> > > > It will probably ask you if you accept the secure connection, than
> > > allow
> > > > it.
> > > >
> > > > 5 - Now, download the dependencies:
> > > >
> > > > cd java/das
> > > >
> > > > mvn
> > > >
> > > > The dependencies should be downloaded.  Let us know if you get any
> > > build
> > > > error on this part.
> > > >
> > > > 6 - Run Netbeans and select File >> New Project.... Select "General"
> > > on
> > > > categories and then "Java Project with Existing Sources" then click
> on
> > > > next
> > > >
> > > > 7 - Give a name to your project, i.e. "DAS", select its folder and
> > > click
> > > > on
> > > > next.
> > > >
> > > > 8 - Click on the first button "Add Folder..." and select the
> following
> > > > folders:
> > > >
> > > > Tuscany\java\das\rdb\src\main\java
> > > >
> > > > Tuscany\java\das\rdb\target\sdo-source
> > > >
> > > > Click on "Finish"
> > > >
> > > > 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
> > > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > > >
> > > > 10 - Right click on DAS project and select properties. Then select
> > > > libraries
> > > > and click on "Add JAR/Folder". Select all the files the folder
> > > > Lib\tuscany-
> > > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > > >
> > > > 11 - Again select File >> New Project... select "Web" on categories
> > > and
> > > > "Web
> > > > Application" then click on next.
> > > >
> > > > 12 - Give a name to your project, i.e. SimpleReadApp, select its
> > > folder
> > > > and
> > > > click on finish.
> > > >
> > > > 13 - Right click on you SimpleReadApp project and select New >>
> > > Servlet.
> > > > Give a name to your servlet, i.e. CommandServlet and click on
> finish.
> > > A
> > > > new
> > > > .java file will be created in SimpleReadApp's Source Packages, open
> it
> > > and
> > > > copy the CommandServlet class code in it.
> > > >
> > > > 14 - Right click on you SimpleReadApp project and select properties.
> > > Then
> > > > select libraries and click on "Add JAR/Folder". Select the file
> > > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside
> > > the
> > > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on
> > > "Open".
> > > >
> > > > 15 - On the same window click on "Add Project...", select the DAS
> > > project
> > > > folder and click on open.
> > > >
> > > > Now you already have what is necessary to run and debug the code.
> > > Don't
> > > > forget to do the adjustments for your dbms:
> > > >
> > > >   - set the jdbc jar file
> > > >
> > > >   - modify the sql statement according to your dbms pl/sql
> > > >
> > > >   - modify the in getConnection method  the jdbc driver class path,
> > > the
> > > > database path, user and password
> > > >
> > > >   - create in your database having an table called "ITEM" that has
> an
> > > > integer attribute called "ID". You must also insert at least an row
> in
> > > > this
> > > > table.
> > > >
> > > > I expect you to debug this simple read app and see for yourselves
> > > which
> > > > classes and methods are needed to implement the simple read app.
> Then
> > > pick
> > > > the classes you want to implement and create a JIRA for it ; )
> > > >
> > > > Adriano Crestani
> > > >
> > > >
> > > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > >
> > > > > Good ideia.... I´ll do it.
> > > > >
> > > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com> wrote:
> > > > > >
> > > > > > I have an idea to make it more independent. Each one that wants
> to
> > >
> > > > help
> > > > > to
> > > > > > implement this simple app, evaluate which class is intended to
> > > > implement
> > > > > > and
> > > > > > create a new JIRA for it. In this new JIRA should be described
> the
> > >
> > > > > classes
> > > > > > and their methods that will be implemented. This way if someone
> > > finish
> > > > > to
> > > > > > implement certain classes, he will be able to choose another
> > > classes
> > > > to
> > > > > > implement, instead of waiting for others to finish their
> classes.
> > > I
> > > > > think
> > > > > > this way we may speed up the das c++ coding.
> > > > > >
> > > > > > Please, if a new JIRA is created report it here in this thread.
> > > > > >
> > > > > > Adriano Crestani
> > > > > >
> > > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > > >
> > > > > > > Okay Adriano.... I will try to understand the simple
> application
> > >
> > > > that
> > > > > > > you´ve
> > > > > > > posted, step by step, and after that I will choose some useful
> > > > classes
> > > > > > as
> > > > > > > well as their essentials methods to run that application in
> C++.
> > >
> > > > > > >
> > > > > > > Douglas S. Leite
> > > > > > >
> > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> wrote:
> > > > > > > >
> > > > > > > > Yes Luciano, but I wasn't sure if there would be any problem
> > > if
> > > > the
> > > > > > > config
> > > > > > > > classes wouldn't be included. We will try to run it without
> > > the
> > > > > config
> > > > > > > > classes though.
> > > > > > > >
> > > > > > > > Douglas, as I had assigned the config classes to you just
> pick
> > > > some
> > > > > > > > classes
> > > > > > > > from those I've assigned to the others. Or if you have
> another
> > > > > > > suggestion
> > > > > > > > in
> > > > > > > > what you could be useful just let us know.
> > > > > > > >
> > > > > > > > Adriano Crestani
> > > > > > > >
> > > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com > wrote:
> > > > > > > > >
> > > > > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > > > > > application
> > > > > > > > > that
> > > > > > > > > only performs a simple read, you shouldn't need the config
> > > > > classes,
> > > > > > > try
> > > > > > > > to
> > > > > > > > > do in C++ something simple as the java sample you just
> > > posted
> > > > > here.
> > > > > > > > >
> > > > > > > > > As for downloads, you only need to download the DAS
> > > > distribution,
> > > > > > that
> > > > > > > > > will
> > > > > > > > > contain all the SDO and other dependencies inside the zip.
> > > For
> > > > the
> > > > > > new
> > > > > > > > > people, I'd recommend using the stable M2 distributions,
> > > > although
> > > > > I
> > > > > > > > think
> > > > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Luciano Resende
> > > > > > > > > http://people.apache.org/~lresende
> > > <http://people.apache.org/%7Elresende>
> > > > > > > > >
> > > > > > > > > On 2/8/07, Adriano Crestani <adrianocrestani@gmail.com >
> > > wrote:
> > > > > > > > > >
> > > > > > > > > > A correction, there is need to download the das also,
> not
> > > only
> > > > > the
> > > > > > > sdo
> > > > > > > > > > .jar:
> > > > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Adriano Crestani <adrianocrestani@gmail.com
> >
> > > > wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes
> the
> > > > first
> > > > > > code
> > > > > > > I
> > > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > > >
> > > > > > > > > > > > Adriano Crestani
> > > > > > > > > > > >
> > > > > > > > > > > > On 2/8/07, Kevin Williams < kevincbw@qwest.net>
> wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > Your focus should probably be on the APIs your DAS
> > > will
> > > > > > > provide
> > > > > > > > > the
> > > > > > > > > > > > > user
> > > > > > > > > > > > > whether that is from a servlet or some other
> > > > caller.  Here
> > > > > > are
> > > > > > > > the
> > > > > > > > > > > > > Java
> > > > > > > > > > > > > DAS apis from the simplest possible read in the
> test
> > > > > suite:
> > > > > > > > > > > > >
> > > > > > > > > > > > >         /**
> > > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > > >          */
> > > > > > > > > > > > >         public void testReadSingle() throws
> > > Exception {
> > > > > > > > > > > > >
> > > > > > > > > > > > >             // Create and initialize command to
> read
> > > > > > customers
> > > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > > (getConnection());
> > > > > > > > > > > > >             Command readCustomers =
> > > das.createCommand
> > > > > > ("select
> > > > > > > *
> > > > > > > > > from
> > > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > > >
> > > > > > > > > > > > >             // Read
> > > > > > > > > > > > >             DataObject root =
> > > readCustomers.executeQuery
> > > > > ();
> > > > > > > > > > > > >
> > > > > > > > > > > > >             // Verify
> > > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > > >         }
> > > > > > > > > > > > >
> > > > > > > > > > > > > Notice that this example also does not allow
> > > > parameterized
> > > > > > > > > > queries.  I
> > > > > > > > > > > > >
> > > > > > > > > > > > > would make this simplifying assumption to get
> > > something
> > > > up
> > > > > > and
> > > > > > > > > > > > > running.
> > > > > > > > > > > > >
> > > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> > > Connection
> > > > > but
> > > > > > I
> > > > > > > > am
> > > > > > > > > > sure
> > > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > > >
> > > > > > > > > > > > > --
> > > > > > > > > > > > > Kevin
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > > 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.Connectionconn,
> > > > > 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 <ke...@qwest.net>
> > > 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:
> > > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > > >>
> > > > > > > > > > > > > >>
> > > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
I created a JIRA(https://issues.apache.org/jira/browse/TUSCANY-1140) to
implement the DAS Lite Command classes that I described here:
http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=45093

Hey guys, I read this article
https://issues.apache.org/jira/browse/TUSCANY-1140 and I think you will like
that, it tells a lot about how c++ sdo works ; )

Adriano Crestani

On 2/27/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> I looked at the maven for netbeans page and it seems interesting, but I
> didn't have time to test it yet.
>
> Sorry Luciano, but what is a webApp skeleton? Could you give an example?
>
>
> On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > Except for the instructions related to NetBeans, most of these steps are
> > defined on the following two links:
> >    http://incubator.apache.org/tuscany/java-projects.html
> > or
> >    http://incubator.apache.org/tuscany/java_das_overview.html
> >
> > Probably would be better for you to review these links and suggest
> > enhancements, as most new users will probably have the same issues as
> > you
> > guys are having.
> >
> > The netBeans steps could probably also be appended to the
> > java-projects.htmllink, together with the instructions on how to use
> > Eclipse or IDEA. BTW,
> > have you seen this :
> >
> > http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
> >
> >
> > Looks like there is a plugin that does the creation of the netBeans
> > project
> > files from the pom
> >
> > mvn netbeans-freeform:generate-netbeans-project
> >
> >
> > Then, for the webAPP, maybe it's easy if you provide a webApp
> > skeleton, then people could only import the war file.
> >
> > Toughts ? Does the link help ?
> >
> >
> > --
> > Luciano Resende
> > http://people.apache.org/~lresende<http://people.apache.org/%7Elresende>
> >
> > On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > As me and Dannyel had some trouble on building and debugging this
> > simple
> > > read app using das java, I created this short howTo to help anyone
> > else
> > > that
> > > is also having difficult to create a project on netbeans IDE to debbug
> > the
> > > code.
> > >
> > > 1 - download subversion(http://subversion.tigris.org/project_packages.html
> > > )
> > > and unpack it
> > >
> > > 2 - download maven 2.0.4 (http://maven.apache.org/download.html ) and
> > > unpack
> > > it
> > >
> > > 3 - set maven/bin and subversion/bin in your SO path
> > >
> > > 4 - create a folder called, i. e. Tuscany, and download the java
> > source
> > > executing the following commands:
> > >
> > > cd tuscany
> > >
> > > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> > >
> > > It will probably ask you if you accept the secure connection, than
> > allow
> > > it.
> > >
> > > 5 - Now, download the dependencies:
> > >
> > > cd java/das
> > >
> > > mvn
> > >
> > > The dependencies should be downloaded.  Let us know if you get any
> > build
> > > error on this part.
> > >
> > > 6 - Run Netbeans and select File >> New Project.... Select "General"
> > on
> > > categories and then "Java Project with Existing Sources" then click on
> > > next
> > >
> > > 7 - Give a name to your project, i.e. "DAS", select its folder and
> > click
> > > on
> > > next.
> > >
> > > 8 - Click on the first button "Add Folder..." and select the following
> > > folders:
> > >
> > > Tuscany\java\das\rdb\src\main\java
> > >
> > > Tuscany\java\das\rdb\target\sdo-source
> > >
> > > Click on "Finish"
> > >
> > > 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
> > > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> > >
> > > 10 - Right click on DAS project and select properties. Then select
> > > libraries
> > > and click on "Add JAR/Folder". Select all the files the folder
> > > Lib\tuscany-
> > > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> > >
> > > 11 - Again select File >> New Project... select "Web" on categories
> > and
> > > "Web
> > > Application" then click on next.
> > >
> > > 12 - Give a name to your project, i.e. SimpleReadApp, select its
> > folder
> > > and
> > > click on finish.
> > >
> > > 13 - Right click on you SimpleReadApp project and select New >>
> > Servlet.
> > > Give a name to your servlet, i.e. CommandServlet and click on finish.
> > A
> > > new
> > > .java file will be created in SimpleReadApp's Source Packages, open it
> > and
> > > copy the CommandServlet class code in it.
> > >
> > > 14 - Right click on you SimpleReadApp project and select properties.
> > Then
> > > select libraries and click on "Add JAR/Folder". Select the file
> > > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside
> > the
> > > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on
> > "Open".
> > >
> > > 15 - On the same window click on "Add Project...", select the DAS
> > project
> > > folder and click on open.
> > >
> > > Now you already have what is necessary to run and debug the code.
> > Don't
> > > forget to do the adjustments for your dbms:
> > >
> > >   - set the jdbc jar file
> > >
> > >   - modify the sql statement according to your dbms pl/sql
> > >
> > >   - modify the in getConnection method  the jdbc driver class path,
> > the
> > > database path, user and password
> > >
> > >   - create in your database having an table called "ITEM" that has an
> > > integer attribute called "ID". You must also insert at least an row in
> > > this
> > > table.
> > >
> > > I expect you to debug this simple read app and see for yourselves
> > which
> > > classes and methods are needed to implement the simple read app. Then
> > pick
> > > the classes you want to implement and create a JIRA for it ; )
> > >
> > > Adriano Crestani
> > >
> > >
> > > On 2/9/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > >
> > > > Good ideia.... I´ll do it.
> > > >
> > > > On 2/9/07, Adriano Crestani < adrianocrestani@gmail.com> wrote:
> > > > >
> > > > > I have an idea to make it more independent. Each one that wants to
> >
> > > help
> > > > to
> > > > > implement this simple app, evaluate which class is intended to
> > > implement
> > > > > and
> > > > > create a new JIRA for it. In this new JIRA should be described the
> >
> > > > classes
> > > > > and their methods that will be implemented. This way if someone
> > finish
> > > > to
> > > > > implement certain classes, he will be able to choose another
> > classes
> > > to
> > > > > implement, instead of waiting for others to finish their classes.
> > I
> > > > think
> > > > > this way we may speed up the das c++ coding.
> > > > >
> > > > > Please, if a new JIRA is created report it here in this thread.
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > > On 2/8/07, Douglas Leite < dougsleite@gmail.com> wrote:
> > > > > >
> > > > > > Okay Adriano.... I will try to understand the simple application
> >
> > > that
> > > > > > you´ve
> > > > > > posted, step by step, and after that I will choose some useful
> > > classes
> > > > > as
> > > > > > well as their essentials methods to run that application in C++.
> >
> > > > > >
> > > > > > Douglas S. Leite
> > > > > >
> > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com> wrote:
> > > > > > >
> > > > > > > Yes Luciano, but I wasn't sure if there would be any problem
> > if
> > > the
> > > > > > config
> > > > > > > classes wouldn't be included. We will try to run it without
> > the
> > > > config
> > > > > > > classes though.
> > > > > > >
> > > > > > > Douglas, as I had assigned the config classes to you just pick
> > > some
> > > > > > > classes
> > > > > > > from those I've assigned to the others. Or if you have another
> > > > > > suggestion
> > > > > > > in
> > > > > > > what you could be useful just let us know.
> > > > > > >
> > > > > > > Adriano Crestani
> > > > > > >
> > > > > > > On 2/8/07, Luciano Resende < luckbr1975@gmail.com > wrote:
> > > > > > > >
> > > > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > > > > application
> > > > > > > > that
> > > > > > > > only performs a simple read, you shouldn't need the config
> > > > classes,
> > > > > > try
> > > > > > > to
> > > > > > > > do in C++ something simple as the java sample you just
> > posted
> > > > here.
> > > > > > > >
> > > > > > > > As for downloads, you only need to download the DAS
> > > distribution,
> > > > > that
> > > > > > > > will
> > > > > > > > contain all the SDO and other dependencies inside the zip.
> > For
> > > the
> > > > > new
> > > > > > > > people, I'd recommend using the stable M2 distributions,
> > > although
> > > > I
> > > > > > > think
> > > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Luciano Resende
> > > > > > > > http://people.apache.org/~lresende
> > <http://people.apache.org/%7Elresende>
> > > > > > > >
> > > > > > > > On 2/8/07, Adriano Crestani <adrianocrestani@gmail.com >
> > wrote:
> > > > > > > > >
> > > > > > > > > A correction, there is need to download the das also, not
> > only
> > > > the
> > > > > > sdo
> > > > > > > > > .jar:
> > > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > > >
> > > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> > wrote:
> > > > > > > > > >
> > > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> > > wrote:
> > > > > > > > > > >
> > > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes the
> > > first
> > > > > code
> > > > > > I
> > > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > > >
> > > > > > > > > > > Adriano Crestani
> > > > > > > > > > >
> > > > > > > > > > > On 2/8/07, Kevin Williams < kevincbw@qwest.net> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Your focus should probably be on the APIs your DAS
> > will
> > > > > > provide
> > > > > > > > the
> > > > > > > > > > > > user
> > > > > > > > > > > > whether that is from a servlet or some other
> > > caller.  Here
> > > > > are
> > > > > > > the
> > > > > > > > > > > > Java
> > > > > > > > > > > > DAS apis from the simplest possible read in the test
> > > > suite:
> > > > > > > > > > > >
> > > > > > > > > > > >         /**
> > > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > > >          */
> > > > > > > > > > > >         public void testReadSingle() throws
> > Exception {
> > > > > > > > > > > >
> > > > > > > > > > > >             // Create and initialize command to read
> > > > > customers
> > > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > > (getConnection());
> > > > > > > > > > > >             Command readCustomers =
> > das.createCommand
> > > > > ("select
> > > > > > *
> > > > > > > > from
> > > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > > >
> > > > > > > > > > > >             // Read
> > > > > > > > > > > >             DataObject root =
> > readCustomers.executeQuery
> > > > ();
> > > > > > > > > > > >
> > > > > > > > > > > >             // Verify
> > > > > > > > > > > >             assertEquals(1, root.getInt
> > > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > > >         }
> > > > > > > > > > > >
> > > > > > > > > > > > Notice that this example also does not allow
> > > parameterized
> > > > > > > > > queries.  I
> > > > > > > > > > > >
> > > > > > > > > > > > would make this simplifying assumption to get
> > something
> > > up
> > > > > and
> > > > > > > > > > > > running.
> > > > > > > > > > > >
> > > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> > Connection
> > > > but
> > > > > I
> > > > > > > am
> > > > > > > > > sure
> > > > > > > > > > > > there is something similar available.
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > Kevin
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > > 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.Connectionconn,
> > > > 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 <ke...@qwest.net>
> > 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:
> > > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > > >>
> > > > > > > > > > > > >>
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
I looked at the maven for netbeans page and it seems interesting, but I
didn't have time to test it yet.

Sorry Luciano, but what is a webApp skeleton? Could you give an example?


On 2/17/07, Luciano Resende <lu...@gmail.com> wrote:
>
> Except for the instructions related to NetBeans, most of these steps are
> defined on the following two links:
>    http://incubator.apache.org/tuscany/java-projects.html
> or
>    http://incubator.apache.org/tuscany/java_das_overview.html
>
> Probably would be better for you to review these links and suggest
> enhancements, as most new users will probably have the same issues as you
> guys are having.
>
> The netBeans steps could probably also be appended to the
> java-projects.htmllink, together with the instructions on how to use
> Eclipse or IDEA. BTW,
> have you seen this :
>
> http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html
>
>
> Looks like there is a plugin that does the creation of the netBeans
> project
> files from the pom
>
> mvn netbeans-freeform:generate-netbeans-project
>
>
> Then, for the webAPP, maybe it's easy if you provide a webApp
> skeleton, then people could only import the war file.
>
> Toughts ? Does the link help ?
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>
>
> On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > As me and Dannyel had some trouble on building and debugging this simple
> > read app using das java, I created this short howTo to help anyone else
> > that
> > is also having difficult to create a project on netbeans IDE to debbug
> the
> > code.
> >
> > 1 - download subversion(http://subversion.tigris.org/project_packages.html
>
> > )
> > and unpack it
> >
> > 2 - download maven 2.0.4 (http://maven.apache.org/download.html) and
> > unpack
> > it
> >
> > 3 - set maven/bin and subversion/bin in your SO path
> >
> > 4 - create a folder called, i. e. Tuscany, and download the java source
> > executing the following commands:
> >
> > cd tuscany
> >
> > svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
> >
> > It will probably ask you if you accept the secure connection, than allow
> > it.
> >
> > 5 - Now, download the dependencies:
> >
> > cd java/das
> >
> > mvn
> >
> > The dependencies should be downloaded.  Let us know if you get any build
> > error on this part.
> >
> > 6 - Run Netbeans and select File >> New Project.... Select "General" on
> > categories and then "Java Project with Existing Sources" then click on
> > next
> >
> > 7 - Give a name to your project, i.e. "DAS", select its folder and click
> > on
> > next.
> >
> > 8 - Click on the first button "Add Folder..." and select the following
> > folders:
> >
> > Tuscany\java\das\rdb\src\main\java
> >
> > Tuscany\java\das\rdb\target\sdo-source
> >
> > Click on "Finish"
> >
> > 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
> > 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
> >
> > 10 - Right click on DAS project and select properties. Then select
> > libraries
> > and click on "Add JAR/Folder". Select all the files the folder
> > Lib\tuscany-
> > das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
> >
> > 11 - Again select File >> New Project... select "Web" on categories and
> > "Web
> > Application" then click on next.
> >
> > 12 - Give a name to your project, i.e. SimpleReadApp, select its folder
> > and
> > click on finish.
> >
> > 13 - Right click on you SimpleReadApp project and select New >> Servlet.
>
> > Give a name to your servlet, i.e. CommandServlet and click on finish. A
> > new
> > .java file will be created in SimpleReadApp's Source Packages, open it
> and
> > copy the CommandServlet class code in it.
> >
> > 14 - Right click on you SimpleReadApp project and select properties.
> Then
> > select libraries and click on "Add JAR/Folder". Select the file
> > sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside the
> > Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on "Open".
> >
> > 15 - On the same window click on "Add Project...", select the DAS
> project
> > folder and click on open.
> >
> > Now you already have what is necessary to run and debug the code. Don't
> > forget to do the adjustments for your dbms:
> >
> >   - set the jdbc jar file
> >
> >   - modify the sql statement according to your dbms pl/sql
> >
> >   - modify the in getConnection method  the jdbc driver class path, the
> > database path, user and password
> >
> >   - create in your database having an table called "ITEM" that has an
> > integer attribute called "ID". You must also insert at least an row in
> > this
> > table.
> >
> > I expect you to debug this simple read app and see for yourselves which
> > classes and methods are needed to implement the simple read app. Then
> pick
> > the classes you want to implement and create a JIRA for it ; )
> >
> > Adriano Crestani
> >
> >
> > On 2/9/07, Douglas Leite <do...@gmail.com> wrote:
> > >
> > > Good ideia.... I´ll do it.
> > >
> > > On 2/9/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > I have an idea to make it more independent. Each one that wants to
> > help
> > > to
> > > > implement this simple app, evaluate which class is intended to
> > implement
> > > > and
> > > > create a new JIRA for it. In this new JIRA should be described the
> > > classes
> > > > and their methods that will be implemented. This way if someone
> finish
> > > to
> > > > implement certain classes, he will be able to choose another classes
> > to
> > > > implement, instead of waiting for others to finish their classes. I
> > > think
> > > > this way we may speed up the das c++ coding.
> > > >
> > > > Please, if a new JIRA is created report it here in this thread.
> > > >
> > > > Adriano Crestani
> > > >
> > > > On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
> > > > >
> > > > > Okay Adriano.... I will try to understand the simple application
> > that
> > > > > you´ve
> > > > > posted, step by step, and after that I will choose some useful
> > classes
> > > > as
> > > > > well as their essentials methods to run that application in C++.
> > > > >
> > > > > Douglas S. Leite
> > > > >
> > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > Yes Luciano, but I wasn't sure if there would be any problem if
> > the
> > > > > config
> > > > > > classes wouldn't be included. We will try to run it without the
> > > config
> > > > > > classes though.
> > > > > >
> > > > > > Douglas, as I had assigned the config classes to you just pick
> > some
> > > > > > classes
> > > > > > from those I've assigned to the others. Or if you have another
> > > > > suggestion
> > > > > > in
> > > > > > what you could be useful just let us know.
> > > > > >
> > > > > > Adriano Crestani
> > > > > >
> > > > > > On 2/8/07, Luciano Resende <luckbr1975@gmail.com > wrote:
> > > > > > >
> > > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > > > application
> > > > > > > that
> > > > > > > only performs a simple read, you shouldn't need the config
> > > classes,
> > > > > try
> > > > > > to
> > > > > > > do in C++ something simple as the java sample you just posted
> > > here.
> > > > > > >
> > > > > > > As for downloads, you only need to download the DAS
> > distribution,
> > > > that
> > > > > > > will
> > > > > > > contain all the SDO and other dependencies inside the zip. For
>
> > the
> > > > new
> > > > > > > people, I'd recommend using the stable M2 distributions,
> > although
> > > I
> > > > > > think
> > > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > > >
> > > > > > > --
> > > > > > > Luciano Resende
> > > > > > > http://people.apache.org/~lresende
> <http://people.apache.org/%7Elresende>
> > > > > > >
> > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > A correction, there is need to download the das also, not
> only
> > > the
> > > > > sdo
> > > > > > > > .jar:
> > > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > > >
> > > > > > > > On 2/8/07, Adriano Crestani < adrianocrestani@gmail.com>
> wrote:
> > > > > > > > >
> > > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > > >
> > > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> > wrote:
> > > > > > > > > >
> > > > > > > > > > Thanks a lot kevin ; ). But I think it look likes the
> > first
> > > > code
> > > > > I
> > > > > > > > > > posted, except by the assert you added.
> > > > > > > > > >
> > > > > > > > > > Adriano Crestani
> > > > > > > > > >
> > > > > > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Your focus should probably be on the APIs your DAS
> will
> > > > > provide
> > > > > > > the
> > > > > > > > > > > user
> > > > > > > > > > > whether that is from a servlet or some other
> > caller.  Here
> > > > are
> > > > > > the
> > > > > > > > > > > Java
> > > > > > > > > > > DAS apis from the simplest possible read in the test
> > > suite:
> > > > > > > > > > >
> > > > > > > > > > >         /**
> > > > > > > > > > >          * Read a specific customer
> > > > > > > > > > >          */
> > > > > > > > > > >         public void testReadSingle() throws Exception
> {
> > > > > > > > > > >
> > > > > > > > > > >             // Create and initialize command to read
> > > > customers
> > > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > > (getConnection());
> > > > > > > > > > >             Command readCustomers = das.createCommand
> > > > ("select
> > > > > *
> > > > > > > from
> > > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > > >
> > > > > > > > > > >             // Read
> > > > > > > > > > >             DataObject root =
> readCustomers.executeQuery
> > > ();
> > > > > > > > > > >
> > > > > > > > > > >             // Verify
> > > > > > > > > > >             assertEquals(1, root.getInt
> > > ("CUSTOMER[1]/ID"));
> > > > > > > > > > >         }
> > > > > > > > > > >
> > > > > > > > > > > Notice that this example also does not allow
> > parameterized
> > > > > > > > queries.  I
> > > > > > > > > > >
> > > > > > > > > > > would make this simplifying assumption to get
> something
> > up
> > > > and
> > > > > > > > > > > running.
> > > > > > > > > > >
> > > > > > > > > > > I cannot help with the C++ equivalent of JDBC
> Connection
> > > but
> > > > I
> > > > > > am
> > > > > > > > sure
> > > > > > > > > > > there is something similar available.
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > Kevin
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > > >
> > > > > > > > > > > > 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 <ke...@qwest.net>
> 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:
> > > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > >> For additional commands, e-mail:
> > > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > > >>
> > > > > > > > > > > >>
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > > > To unsubscribe, e-mail:
> > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > > For additional commands, e-mail:
> > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
Except for the instructions related to NetBeans, most of these steps are
defined on the following two links:
   http://incubator.apache.org/tuscany/java-projects.html
or
   http://incubator.apache.org/tuscany/java_das_overview.html

Probably would be better for you to review these links and suggest
enhancements, as most new users will probably have the same issues as you
guys are having.

The netBeans steps could probably also be appended to the
java-projects.htmllink, together with the instructions on how to use
Eclipse or IDEA. BTW,
have you seen this :

http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html

Looks like there is a plugin that does the creation of the netBeans project
files from the pom

mvn netbeans-freeform:generate-netbeans-project


Then, for the webAPP, maybe it's easy if you provide a webApp
skeleton, then people could only import the war file.

Toughts ? Does the link help ?


-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/16/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> As me and Dannyel had some trouble on building and debugging this simple
> read app using das java, I created this short howTo to help anyone else
> that
> is also having difficult to create a project on netbeans IDE to debbug the
> code.
>
> 1 - download subversion(http://subversion.tigris.org/project_packages.html
> )
> and unpack it
>
> 2 - download maven 2.0.4 (http://maven.apache.org/download.html) and
> unpack
> it
>
> 3 - set maven/bin and subversion/bin in your SO path
>
> 4 - create a folder called, i. e. Tuscany, and download the java source
> executing the following commands:
>
> cd tuscany
>
> svn co https://svn.apache.org/repos/asf/incubator/tuscany/java
>
> It will probably ask you if you accept the secure connection, than allow
> it.
>
> 5 - Now, download the dependencies:
>
> cd java/das
>
> mvn
>
> The dependencies should be downloaded.  Let us know if you get any build
> error on this part.
>
> 6 - Run Netbeans and select File >> New Project.... Select "General" on
> categories and then "Java Project with Existing Sources" then click on
> next
>
> 7 - Give a name to your project, i.e. "DAS", select its folder and click
> on
> next.
>
> 8 - Click on the first button "Add Folder..." and select the following
> folders:
>
> Tuscany\java\das\rdb\src\main\java
>
> Tuscany\java\das\rdb\target\sdo-source
>
> Click on "Finish"
>
> 9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
> 1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.
>
> 10 - Right click on DAS project and select properties. Then select
> libraries
> and click on "Add JAR/Folder". Select all the files the folder
> Lib\tuscany-
> das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".
>
> 11 - Again select File >> New Project... select "Web" on categories and
> "Web
> Application" then click on next.
>
> 12 - Give a name to your project, i.e. SimpleReadApp, select its folder
> and
> click on finish.
>
> 13 - Right click on you SimpleReadApp project and select New >> Servlet.
> Give a name to your servlet, i.e. CommandServlet and click on finish. A
> new
> .java file will be created in SimpleReadApp's Source Packages, open it and
> copy the CommandServlet class code in it.
>
> 14 - Right click on you SimpleReadApp project and select properties. Then
> select libraries and click on "Add JAR/Folder". Select the file
> sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside the
> Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on "Open".
>
> 15 - On the same window click on "Add Project...", select the DAS project
> folder and click on open.
>
> Now you already have what is necessary to run and debug the code. Don't
> forget to do the adjustments for your dbms:
>
>   - set the jdbc jar file
>
>   - modify the sql statement according to your dbms pl/sql
>
>   - modify the in getConnection method  the jdbc driver class path, the
> database path, user and password
>
>   - create in your database having an table called "ITEM" that has an
> integer attribute called "ID". You must also insert at least an row in
> this
> table.
>
> I expect you to debug this simple read app and see for yourselves which
> classes and methods are needed to implement the simple read app. Then pick
> the classes you want to implement and create a JIRA for it ; )
>
> Adriano Crestani
>
>
> On 2/9/07, Douglas Leite <do...@gmail.com> wrote:
> >
> > Good ideia.... I´ll do it.
> >
> > On 2/9/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > I have an idea to make it more independent. Each one that wants to
> help
> > to
> > > implement this simple app, evaluate which class is intended to
> implement
> > > and
> > > create a new JIRA for it. In this new JIRA should be described the
> > classes
> > > and their methods that will be implemented. This way if someone finish
> > to
> > > implement certain classes, he will be able to choose another classes
> to
> > > implement, instead of waiting for others to finish their classes. I
> > think
> > > this way we may speed up the das c++ coding.
> > >
> > > Please, if a new JIRA is created report it here in this thread.
> > >
> > > Adriano Crestani
> > >
> > > On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
> > > >
> > > > Okay Adriano.... I will try to understand the simple application
> that
> > > > you´ve
> > > > posted, step by step, and after that I will choose some useful
> classes
> > > as
> > > > well as their essentials methods to run that application in C++.
> > > >
> > > > Douglas S. Leite
> > > >
> > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > Yes Luciano, but I wasn't sure if there would be any problem if
> the
> > > > config
> > > > > classes wouldn't be included. We will try to run it without the
> > config
> > > > > classes though.
> > > > >
> > > > > Douglas, as I had assigned the config classes to you just pick
> some
> > > > > classes
> > > > > from those I've assigned to the others. Or if you have another
> > > > suggestion
> > > > > in
> > > > > what you could be useful just let us know.
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > > On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > > >
> > > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > > application
> > > > > > that
> > > > > > only performs a simple read, you shouldn't need the config
> > classes,
> > > > try
> > > > > to
> > > > > > do in C++ something simple as the java sample you just posted
> > here.
> > > > > >
> > > > > > As for downloads, you only need to download the DAS
> distribution,
> > > that
> > > > > > will
> > > > > > contain all the SDO and other dependencies inside the zip. For
> the
> > > new
> > > > > > people, I'd recommend using the stable M2 distributions,
> although
> > I
> > > > > think
> > > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > > >
> > > > > > --
> > > > > > Luciano Resende
> > > > > > http://people.apache.org/~lresende
> > > > > >
> > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > A correction, there is need to download the das also, not only
> > the
> > > > sdo
> > > > > > > .jar:
> > > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > > >
> > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > > >
> > > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com>
> wrote:
> > > > > > > > >
> > > > > > > > > Thanks a lot kevin ; ). But I think it look likes the
> first
> > > code
> > > > I
> > > > > > > > > posted, except by the assert you added.
> > > > > > > > >
> > > > > > > > > Adriano Crestani
> > > > > > > > >
> > > > > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > > > > >
> > > > > > > > > > Your focus should probably be on the APIs your DAS will
> > > > provide
> > > > > > the
> > > > > > > > > > user
> > > > > > > > > > whether that is from a servlet or some other
> caller.  Here
> > > are
> > > > > the
> > > > > > > > > > Java
> > > > > > > > > > DAS apis from the simplest possible read in the test
> > suite:
> > > > > > > > > >
> > > > > > > > > >         /**
> > > > > > > > > >          * Read a specific customer
> > > > > > > > > >          */
> > > > > > > > > >         public void testReadSingle() throws Exception {
> > > > > > > > > >
> > > > > > > > > >             // Create and initialize command to read
> > > customers
> > > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > > (getConnection());
> > > > > > > > > >             Command readCustomers = das.createCommand
> > > ("select
> > > > *
> > > > > > from
> > > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > > >
> > > > > > > > > >             // Read
> > > > > > > > > >             DataObject root = readCustomers.executeQuery
> > ();
> > > > > > > > > >
> > > > > > > > > >             // Verify
> > > > > > > > > >             assertEquals(1, root.getInt
> > ("CUSTOMER[1]/ID"));
> > > > > > > > > >         }
> > > > > > > > > >
> > > > > > > > > > Notice that this example also does not allow
> parameterized
> > > > > > > queries.  I
> > > > > > > > > >
> > > > > > > > > > would make this simplifying assumption to get something
> up
> > > and
> > > > > > > > > > running.
> > > > > > > > > >
> > > > > > > > > > I cannot help with the C++ equivalent of JDBC Connection
> > but
> > > I
> > > > > am
> > > > > > > sure
> > > > > > > > > > there is something similar available.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Kevin
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Adriano Crestani wrote:
> > > > > > > > > >
> > > > > > > > > > > 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 <ke...@qwest.net> 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:
> > > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > >> For additional commands, e-mail:
> > > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > > >>
> > > > > > > > > > >>
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > > > > > > To unsubscribe, e-mail:
> > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > > For additional commands, e-mail:
> > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
As me and Dannyel had some trouble on building and debugging this simple
read app using das java, I created this short howTo to help anyone else that
is also having difficult to create a project on netbeans IDE to debbug the
code.

1 - download subversion(http://subversion.tigris.org/project_packages.html)
and unpack it

2 - download maven 2.0.4 (http://maven.apache.org/download.html) and unpack
it

3 - set maven/bin and subversion/bin in your SO path

4 - create a folder called, i. e. Tuscany, and download the java source
executing the following commands:

cd tuscany

svn co https://svn.apache.org/repos/asf/incubator/tuscany/java

It will probably ask you if you accept the secure connection, than allow it.

5 - Now, download the dependencies:

cd java/das

mvn

The dependencies should be downloaded.  Let us know if you get any build
error on this part.

6 - Run Netbeans and select File >> New Project.... Select "General" on
categories and then "Java Project with Existing Sources" then click on next

7 - Give a name to your project, i.e. "DAS", select its folder and click on
next.

8 - Click on the first button "Add Folder..." and select the following
folders:

Tuscany\java\das\rdb\src\main\java

Tuscany\java\das\rdb\target\sdo-source

Click on "Finish"

9 - Unpack the file Tuscany\java\das\distribution\binary\target\das-
1.0-incubator-SNAPSHOT-bin.zip in a folder, i.e. Lib.

10 - Right click on DAS project and select properties. Then select libraries
and click on "Add JAR/Folder". Select all the files the folder Lib\tuscany-
das-1.0-incubator-SNAPSHOT\lib contains and click on "Open".

11 - Again select File >> New Project... select "Web" on categories and "Web
Application" then click on next.

12 - Give a name to your project, i.e. SimpleReadApp, select its folder and
click on finish.

13 - Right click on you SimpleReadApp project and select New >> Servlet.
Give a name to your servlet, i.e. CommandServlet and click on finish. A new
.java file will be created in SimpleReadApp's Source Packages, open it and
copy the CommandServlet class code in it.

14 - Right click on you SimpleReadApp project and select properties. Then
select libraries and click on "Add JAR/Folder". Select the file
sdo-api-r2.1-1.0-incubator-20061220.211548-2.jar that resides inside the
Libs\tuscany-das-1.0-incubator-SNAPSHOT\lib folder and click on "Open".

15 - On the same window click on "Add Project...", select the DAS project
folder and click on open.

Now you already have what is necessary to run and debug the code. Don't
forget to do the adjustments for your dbms:

  - set the jdbc jar file

  - modify the sql statement according to your dbms pl/sql

  - modify the in getConnection method  the jdbc driver class path, the
database path, user and password

  - create in your database having an table called "ITEM" that has an
integer attribute called "ID". You must also insert at least an row in this
table.

I expect you to debug this simple read app and see for yourselves which
classes and methods are needed to implement the simple read app. Then pick
the classes you want to implement and create a JIRA for it ; )

Adriano Crestani


On 2/9/07, Douglas Leite <do...@gmail.com> wrote:
>
> Good ideia.... I´ll do it.
>
> On 2/9/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > I have an idea to make it more independent. Each one that wants to help
> to
> > implement this simple app, evaluate which class is intended to implement
> > and
> > create a new JIRA for it. In this new JIRA should be described the
> classes
> > and their methods that will be implemented. This way if someone finish
> to
> > implement certain classes, he will be able to choose another classes to
> > implement, instead of waiting for others to finish their classes. I
> think
> > this way we may speed up the das c++ coding.
> >
> > Please, if a new JIRA is created report it here in this thread.
> >
> > Adriano Crestani
> >
> > On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
> > >
> > > Okay Adriano.... I will try to understand the simple application that
> > > you´ve
> > > posted, step by step, and after that I will choose some useful classes
> > as
> > > well as their essentials methods to run that application in C++.
> > >
> > > Douglas S. Leite
> > >
> > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > Yes Luciano, but I wasn't sure if there would be any problem if the
> > > config
> > > > classes wouldn't be included. We will try to run it without the
> config
> > > > classes though.
> > > >
> > > > Douglas, as I had assigned the config classes to you just pick some
> > > > classes
> > > > from those I've assigned to the others. Or if you have another
> > > suggestion
> > > > in
> > > > what you could be useful just let us know.
> > > >
> > > > Adriano Crestani
> > > >
> > > > On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
> > > > >
> > > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> > application
> > > > > that
> > > > > only performs a simple read, you shouldn't need the config
> classes,
> > > try
> > > > to
> > > > > do in C++ something simple as the java sample you just posted
> here.
> > > > >
> > > > > As for downloads, you only need to download the DAS distribution,
> > that
> > > > > will
> > > > > contain all the SDO and other dependencies inside the zip. For the
> > new
> > > > > people, I'd recommend using the stable M2 distributions, although
> I
> > > > think
> > > > > SDO and DAS trunk code are stable and compiling fine.
> > > > >
> > > > > --
> > > > > Luciano Resende
> > > > > http://people.apache.org/~lresende
> > > > >
> > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > A correction, there is need to download the das also, not only
> the
> > > sdo
> > > > > > .jar:
> > > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > > >
> > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > Anyway, it simplified a lot the ap ; )
> > > > > > >
> > > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > Thanks a lot kevin ; ). But I think it look likes the first
> > code
> > > I
> > > > > > > > posted, except by the assert you added.
> > > > > > > >
> > > > > > > > Adriano Crestani
> > > > > > > >
> > > > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > > > >
> > > > > > > > > Your focus should probably be on the APIs your DAS will
> > > provide
> > > > > the
> > > > > > > > > user
> > > > > > > > > whether that is from a servlet or some other caller.  Here
> > are
> > > > the
> > > > > > > > > Java
> > > > > > > > > DAS apis from the simplest possible read in the test
> suite:
> > > > > > > > >
> > > > > > > > >         /**
> > > > > > > > >          * Read a specific customer
> > > > > > > > >          */
> > > > > > > > >         public void testReadSingle() throws Exception {
> > > > > > > > >
> > > > > > > > >             // Create and initialize command to read
> > customers
> > > > > > > > >             DAS das = DAS.FACTORY.createDAS
> > (getConnection());
> > > > > > > > >             Command readCustomers = das.createCommand
> > ("select
> > > *
> > > > > from
> > > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > > >
> > > > > > > > >             // Read
> > > > > > > > >             DataObject root = readCustomers.executeQuery
> ();
> > > > > > > > >
> > > > > > > > >             // Verify
> > > > > > > > >             assertEquals(1, root.getInt
> ("CUSTOMER[1]/ID"));
> > > > > > > > >         }
> > > > > > > > >
> > > > > > > > > Notice that this example also does not allow parameterized
> > > > > > queries.  I
> > > > > > > > >
> > > > > > > > > would make this simplifying assumption to get something up
> > and
> > > > > > > > > running.
> > > > > > > > >
> > > > > > > > > I cannot help with the C++ equivalent of JDBC Connection
> but
> > I
> > > > am
> > > > > > sure
> > > > > > > > > there is something similar available.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Kevin
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Adriano Crestani wrote:
> > > > > > > > >
> > > > > > > > > > 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 <ke...@qwest.net> 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:
> > > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > >> For additional commands, e-mail:
> > > > tuscany-dev-help@ws.apache.org
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > To unsubscribe, e-mail:
> > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > > For additional commands, e-mail:
> > > tuscany-dev-help@ws.apache.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Douglas Leite <do...@gmail.com>.
Good ideia.... I´ll do it.

On 2/9/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> I have an idea to make it more independent. Each one that wants to help to
> implement this simple app, evaluate which class is intended to implement
> and
> create a new JIRA for it. In this new JIRA should be described the classes
> and their methods that will be implemented. This way if someone finish to
> implement certain classes, he will be able to choose another classes to
> implement, instead of waiting for others to finish their classes. I think
> this way we may speed up the das c++ coding.
>
> Please, if a new JIRA is created report it here in this thread.
>
> Adriano Crestani
>
> On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
> >
> > Okay Adriano.... I will try to understand the simple application that
> > you´ve
> > posted, step by step, and after that I will choose some useful classes
> as
> > well as their essentials methods to run that application in C++.
> >
> > Douglas S. Leite
> >
> > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > Yes Luciano, but I wasn't sure if there would be any problem if the
> > config
> > > classes wouldn't be included. We will try to run it without the config
> > > classes though.
> > >
> > > Douglas, as I had assigned the config classes to you just pick some
> > > classes
> > > from those I've assigned to the others. Or if you have another
> > suggestion
> > > in
> > > what you could be useful just let us know.
> > >
> > > Adriano Crestani
> > >
> > > On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
> > > >
> > > > I'd agree with Kevin's suggestion, for a simple C++ sample
> application
> > > > that
> > > > only performs a simple read, you shouldn't need the config classes,
> > try
> > > to
> > > > do in C++ something simple as the java sample you just posted here.
> > > >
> > > > As for downloads, you only need to download the DAS distribution,
> that
> > > > will
> > > > contain all the SDO and other dependencies inside the zip. For the
> new
> > > > people, I'd recommend using the stable M2 distributions, although I
> > > think
> > > > SDO and DAS trunk code are stable and compiling fine.
> > > >
> > > > --
> > > > Luciano Resende
> > > > http://people.apache.org/~lresende
> > > >
> > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > A correction, there is need to download the das also, not only the
> > sdo
> > > > > .jar:
> > > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > > >
> > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > Anyway, it simplified a lot the ap ; )
> > > > > >
> > > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > > >
> > > > > > > Thanks a lot kevin ; ). But I think it look likes the first
> code
> > I
> > > > > > > posted, except by the assert you added.
> > > > > > >
> > > > > > > Adriano Crestani
> > > > > > >
> > > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > > >
> > > > > > > > Your focus should probably be on the APIs your DAS will
> > provide
> > > > the
> > > > > > > > user
> > > > > > > > whether that is from a servlet or some other caller.  Here
> are
> > > the
> > > > > > > > Java
> > > > > > > > DAS apis from the simplest possible read in the test suite:
> > > > > > > >
> > > > > > > >         /**
> > > > > > > >          * Read a specific customer
> > > > > > > >          */
> > > > > > > >         public void testReadSingle() throws Exception {
> > > > > > > >
> > > > > > > >             // Create and initialize command to read
> customers
> > > > > > > >             DAS das = DAS.FACTORY.createDAS
> (getConnection());
> > > > > > > >             Command readCustomers = das.createCommand
> ("select
> > *
> > > > from
> > > > > > > >     CUSTOMER where ID = 1");
> > > > > > > >
> > > > > > > >             // Read
> > > > > > > >             DataObject root = readCustomers.executeQuery();
> > > > > > > >
> > > > > > > >             // Verify
> > > > > > > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > > > > > > >         }
> > > > > > > >
> > > > > > > > Notice that this example also does not allow parameterized
> > > > > queries.  I
> > > > > > > >
> > > > > > > > would make this simplifying assumption to get something up
> and
> > > > > > > > running.
> > > > > > > >
> > > > > > > > I cannot help with the C++ equivalent of JDBC Connection but
> I
> > > am
> > > > > sure
> > > > > > > > there is something similar available.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Kevin
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Adriano Crestani wrote:
> > > > > > > >
> > > > > > > > > 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 <ke...@qwest.net> 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:
> > tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > >> For additional commands, e-mail:
> > > tuscany-dev-help@ws.apache.org
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > > For additional commands, e-mail:
> > tuscany-dev-help@ws.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
I have an idea to make it more independent. Each one that wants to help to
implement this simple app, evaluate which class is intended to implement and
create a new JIRA for it. In this new JIRA should be described the classes
and their methods that will be implemented. This way if someone finish to
implement certain classes, he will be able to choose another classes to
implement, instead of waiting for others to finish their classes. I think
this way we may speed up the das c++ coding.

Please, if a new JIRA is created report it here in this thread.

Adriano Crestani

On 2/8/07, Douglas Leite <do...@gmail.com> wrote:
>
> Okay Adriano.... I will try to understand the simple application that
> you´ve
> posted, step by step, and after that I will choose some useful classes as
> well as their essentials methods to run that application in C++.
>
> Douglas S. Leite
>
> On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > Yes Luciano, but I wasn't sure if there would be any problem if the
> config
> > classes wouldn't be included. We will try to run it without the config
> > classes though.
> >
> > Douglas, as I had assigned the config classes to you just pick some
> > classes
> > from those I've assigned to the others. Or if you have another
> suggestion
> > in
> > what you could be useful just let us know.
> >
> > Adriano Crestani
> >
> > On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
> > >
> > > I'd agree with Kevin's suggestion, for a simple C++ sample application
> > > that
> > > only performs a simple read, you shouldn't need the config classes,
> try
> > to
> > > do in C++ something simple as the java sample you just posted here.
> > >
> > > As for downloads, you only need to download the DAS distribution, that
> > > will
> > > contain all the SDO and other dependencies inside the zip. For the new
> > > people, I'd recommend using the stable M2 distributions, although I
> > think
> > > SDO and DAS trunk code are stable and compiling fine.
> > >
> > > --
> > > Luciano Resende
> > > http://people.apache.org/~lresende
> > >
> > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > A correction, there is need to download the das also, not only the
> sdo
> > > > .jar:
> > > > http://incubator.apache.org/tuscany/das_downloads.html
> > > >
> > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > Anyway, it simplified a lot the ap ; )
> > > > >
> > > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > > >
> > > > > > Thanks a lot kevin ; ). But I think it look likes the first code
> I
> > > > > > posted, except by the assert you added.
> > > > > >
> > > > > > Adriano Crestani
> > > > > >
> > > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > > >
> > > > > > > Your focus should probably be on the APIs your DAS will
> provide
> > > the
> > > > > > > user
> > > > > > > whether that is from a servlet or some other caller.  Here are
> > the
> > > > > > > Java
> > > > > > > DAS apis from the simplest possible read in the test suite:
> > > > > > >
> > > > > > >         /**
> > > > > > >          * Read a specific customer
> > > > > > >          */
> > > > > > >         public void testReadSingle() throws Exception {
> > > > > > >
> > > > > > >             // Create and initialize command to read customers
> > > > > > >             DAS das = DAS.FACTORY.createDAS(getConnection());
> > > > > > >             Command readCustomers = das.createCommand("select
> *
> > > from
> > > > > > >     CUSTOMER where ID = 1");
> > > > > > >
> > > > > > >             // Read
> > > > > > >             DataObject root = readCustomers.executeQuery();
> > > > > > >
> > > > > > >             // Verify
> > > > > > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > > > > > >         }
> > > > > > >
> > > > > > > Notice that this example also does not allow parameterized
> > > > queries.  I
> > > > > > >
> > > > > > > would make this simplifying assumption to get something up and
> > > > > > > running.
> > > > > > >
> > > > > > > I cannot help with the C++ equivalent of JDBC Connection but I
> > am
> > > > sure
> > > > > > > there is something similar available.
> > > > > > >
> > > > > > > --
> > > > > > > Kevin
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Adriano Crestani wrote:
> > > > > > >
> > > > > > > > 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 <ke...@qwest.net> 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:
> tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > >> For additional commands, e-mail:
> > tuscany-dev-help@ws.apache.org
> > > > > > > >>
> > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > > > > > For additional commands, e-mail:
> tuscany-dev-help@ws.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Douglas Leite <do...@gmail.com>.
Okay Adriano.... I will try to understand the simple application that you´ve
posted, step by step, and after that I will choose some useful classes as
well as their essentials methods to run that application in C++.

Douglas S. Leite

On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> Yes Luciano, but I wasn't sure if there would be any problem if the config
> classes wouldn't be included. We will try to run it without the config
> classes though.
>
> Douglas, as I had assigned the config classes to you just pick some
> classes
> from those I've assigned to the others. Or if you have another suggestion
> in
> what you could be useful just let us know.
>
> Adriano Crestani
>
> On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
> >
> > I'd agree with Kevin's suggestion, for a simple C++ sample application
> > that
> > only performs a simple read, you shouldn't need the config classes, try
> to
> > do in C++ something simple as the java sample you just posted here.
> >
> > As for downloads, you only need to download the DAS distribution, that
> > will
> > contain all the SDO and other dependencies inside the zip. For the new
> > people, I'd recommend using the stable M2 distributions, although I
> think
> > SDO and DAS trunk code are stable and compiling fine.
> >
> > --
> > Luciano Resende
> > http://people.apache.org/~lresende
> >
> > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > A correction, there is need to download the das also, not only the sdo
> > > .jar:
> > > http://incubator.apache.org/tuscany/das_downloads.html
> > >
> > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > Anyway, it simplified a lot the ap ; )
> > > >
> > > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > > >
> > > > > Thanks a lot kevin ; ). But I think it look likes the first code I
> > > > > posted, except by the assert you added.
> > > > >
> > > > > Adriano Crestani
> > > > >
> > > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > > >
> > > > > > Your focus should probably be on the APIs your DAS will provide
> > the
> > > > > > user
> > > > > > whether that is from a servlet or some other caller.  Here are
> the
> > > > > > Java
> > > > > > DAS apis from the simplest possible read in the test suite:
> > > > > >
> > > > > >         /**
> > > > > >          * Read a specific customer
> > > > > >          */
> > > > > >         public void testReadSingle() throws Exception {
> > > > > >
> > > > > >             // Create and initialize command to read customers
> > > > > >             DAS das = DAS.FACTORY.createDAS(getConnection());
> > > > > >             Command readCustomers = das.createCommand("select *
> > from
> > > > > >     CUSTOMER where ID = 1");
> > > > > >
> > > > > >             // Read
> > > > > >             DataObject root = readCustomers.executeQuery();
> > > > > >
> > > > > >             // Verify
> > > > > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > > > > >         }
> > > > > >
> > > > > > Notice that this example also does not allow parameterized
> > > queries.  I
> > > > > >
> > > > > > would make this simplifying assumption to get something up and
> > > > > > running.
> > > > > >
> > > > > > I cannot help with the C++ equivalent of JDBC Connection but I
> am
> > > sure
> > > > > > there is something similar available.
> > > > > >
> > > > > > --
> > > > > > Kevin
> > > > > >
> > > > > >
> > > > > >
> > > > > > Adriano Crestani wrote:
> > > > > >
> > > > > > > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> > > > > > >> For additional commands, e-mail:
> tuscany-dev-help@ws.apache.org
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > > > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
Yes Luciano, but I wasn't sure if there would be any problem if the config
classes wouldn't be included. We will try to run it without the config
classes though.

Douglas, as I had assigned the config classes to you just pick some classes
from those I've assigned to the others. Or if you have another suggestion in
what you could be useful just let us know.

Adriano Crestani

On 2/8/07, Luciano Resende <lu...@gmail.com> wrote:
>
> I'd agree with Kevin's suggestion, for a simple C++ sample application
> that
> only performs a simple read, you shouldn't need the config classes, try to
> do in C++ something simple as the java sample you just posted here.
>
> As for downloads, you only need to download the DAS distribution, that
> will
> contain all the SDO and other dependencies inside the zip. For the new
> people, I'd recommend using the stable M2 distributions, although I think
> SDO and DAS trunk code are stable and compiling fine.
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
>
> On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > A correction, there is need to download the das also, not only the sdo
> > .jar:
> > http://incubator.apache.org/tuscany/das_downloads.html
> >
> > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > Anyway, it simplified a lot the ap ; )
> > >
> > > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > > >
> > > > Thanks a lot kevin ; ). But I think it look likes the first code I
> > > > posted, except by the assert you added.
> > > >
> > > > Adriano Crestani
> > > >
> > > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > > >
> > > > > Your focus should probably be on the APIs your DAS will provide
> the
> > > > > user
> > > > > whether that is from a servlet or some other caller.  Here are the
> > > > > Java
> > > > > DAS apis from the simplest possible read in the test suite:
> > > > >
> > > > >         /**
> > > > >          * Read a specific customer
> > > > >          */
> > > > >         public void testReadSingle() throws Exception {
> > > > >
> > > > >             // Create and initialize command to read customers
> > > > >             DAS das = DAS.FACTORY.createDAS(getConnection());
> > > > >             Command readCustomers = das.createCommand("select *
> from
> > > > >     CUSTOMER where ID = 1");
> > > > >
> > > > >             // Read
> > > > >             DataObject root = readCustomers.executeQuery();
> > > > >
> > > > >             // Verify
> > > > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > > > >         }
> > > > >
> > > > > Notice that this example also does not allow parameterized
> > queries.  I
> > > > >
> > > > > would make this simplifying assumption to get something up and
> > > > > running.
> > > > >
> > > > > I cannot help with the C++ equivalent of JDBC Connection but I am
> > sure
> > > > > there is something similar available.
> > > > >
> > > > > --
> > > > > Kevin
> > > > >
> > > > >
> > > > >
> > > > > Adriano Crestani wrote:
> > > > >
> > > > > > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> > > > > >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > > > >>
> > > > > >>
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Luciano Resende <lu...@gmail.com>.
I'd agree with Kevin's suggestion, for a simple C++ sample application that
only performs a simple read, you shouldn't need the config classes, try to
do in C++ something simple as the java sample you just posted here.

As for downloads, you only need to download the DAS distribution, that will
contain all the SDO and other dependencies inside the zip. For the new
people, I'd recommend using the stable M2 distributions, although I think
SDO and DAS trunk code are stable and compiling fine.

-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> A correction, there is need to download the das also, not only the sdo
> .jar:
> http://incubator.apache.org/tuscany/das_downloads.html
>
> On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > Anyway, it simplified a lot the ap ; )
> >
> > On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> > >
> > > Thanks a lot kevin ; ). But I think it look likes the first code I
> > > posted, except by the assert you added.
> > >
> > > Adriano Crestani
> > >
> > > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > > >
> > > > Your focus should probably be on the APIs your DAS will provide the
> > > > user
> > > > whether that is from a servlet or some other caller.  Here are the
> > > > Java
> > > > DAS apis from the simplest possible read in the test suite:
> > > >
> > > >         /**
> > > >          * Read a specific customer
> > > >          */
> > > >         public void testReadSingle() throws Exception {
> > > >
> > > >             // Create and initialize command to read customers
> > > >             DAS das = DAS.FACTORY.createDAS(getConnection());
> > > >             Command readCustomers = das.createCommand("select * from
> > > >     CUSTOMER where ID = 1");
> > > >
> > > >             // Read
> > > >             DataObject root = readCustomers.executeQuery();
> > > >
> > > >             // Verify
> > > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > > >         }
> > > >
> > > > Notice that this example also does not allow parameterized
> queries.  I
> > > >
> > > > would make this simplifying assumption to get something up and
> > > > running.
> > > >
> > > > I cannot help with the C++ equivalent of JDBC Connection but I am
> sure
> > > > there is something similar available.
> > > >
> > > > --
> > > > Kevin
> > > >
> > > >
> > > >
> > > > Adriano Crestani wrote:
> > > >
> > > > > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> > > > >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > > >>
> > > > >>
> > > > >
> > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > >
> > > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
A correction, there is need to download the das also, not only the sdo .jar:
http://incubator.apache.org/tuscany/das_downloads.html

On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> Anyway, it simplified a lot the ap ; )
>
> On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
> >
> > Thanks a lot kevin ; ). But I think it look likes the first code I
> > posted, except by the assert you added.
> >
> > Adriano Crestani
> >
> > On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> > >
> > > Your focus should probably be on the APIs your DAS will provide the
> > > user
> > > whether that is from a servlet or some other caller.  Here are the
> > > Java
> > > DAS apis from the simplest possible read in the test suite:
> > >
> > >         /**
> > >          * Read a specific customer
> > >          */
> > >         public void testReadSingle() throws Exception {
> > >
> > >             // Create and initialize command to read customers
> > >             DAS das = DAS.FACTORY.createDAS(getConnection());
> > >             Command readCustomers = das.createCommand("select * from
> > >     CUSTOMER where ID = 1");
> > >
> > >             // Read
> > >             DataObject root = readCustomers.executeQuery();
> > >
> > >             // Verify
> > >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> > >         }
> > >
> > > Notice that this example also does not allow parameterized queries.  I
> > >
> > > would make this simplifying assumption to get something up and
> > > running.
> > >
> > > I cannot help with the C++ equivalent of JDBC Connection but I am sure
> > > there is something similar available.
> > >
> > > --
> > > Kevin
> > >
> > >
> > >
> > > Adriano Crestani wrote:
> > >
> > > > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> > > >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > > >>
> > > >>
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >
> > >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
Anyway, it simplified a lot the ap ; )

On 2/8/07, Adriano Crestani <ad...@gmail.com> wrote:
>
> Thanks a lot kevin ; ). But I think it look likes the first code I posted,
> except by the assert you added.
>
> Adriano Crestani
>
> On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
> >
> > Your focus should probably be on the APIs your DAS will provide the user
> >
> > whether that is from a servlet or some other caller.  Here are the Java
> > DAS apis from the simplest possible read in the test suite:
> >
> >         /**
> >          * Read a specific customer
> >          */
> >         public void testReadSingle() throws Exception {
> >
> >             // Create and initialize command to read customers
> >             DAS das = DAS.FACTORY.createDAS(getConnection());
> >             Command readCustomers = das.createCommand("select * from
> >     CUSTOMER where ID = 1");
> >
> >             // Read
> >             DataObject root = readCustomers.executeQuery();
> >
> >             // Verify
> >             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
> >         }
> >
> > Notice that this example also does not allow parameterized queries.  I
> > would make this simplifying assumption to get something up and running.
> >
> > I cannot help with the C++ equivalent of JDBC Connection but I am sure
> > there is something similar available.
> >
> > --
> > Kevin
> >
> >
> >
> > Adriano Crestani wrote:
> >
> > > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> > >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >>
> > >>
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
Thanks a lot kevin ; ). But I think it look likes the first code I posted,
except by the assert you added.

Adriano Crestani

On 2/8/07, Kevin Williams <ke...@qwest.net> wrote:
>
> Your focus should probably be on the APIs your DAS will provide the user
> whether that is from a servlet or some other caller.  Here are the Java
> DAS apis from the simplest possible read in the test suite:
>
>         /**
>          * Read a specific customer
>          */
>         public void testReadSingle() throws Exception {
>
>             // Create and initialize command to read customers
>             DAS das = DAS.FACTORY.createDAS(getConnection());
>             Command readCustomers = das.createCommand("select * from
>     CUSTOMER where ID = 1");
>
>             // Read
>             DataObject root = readCustomers.executeQuery();
>
>             // Verify
>             assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
>         }
>
> Notice that this example also does not allow parameterized queries.  I
> would make this simplifying assumption to get something up and running.
>
> I cannot help with the C++ equivalent of JDBC Connection but I am sure
> there is something similar available.
>
> --
> Kevin
>
>
>
> Adriano Crestani wrote:
>
> > 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >>
> >>
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Kevin Williams <ke...@qwest.net>.
Your focus should probably be on the APIs your DAS will provide the user 
whether that is from a servlet or some other caller.  Here are the Java 
DAS apis from the simplest possible read in the test suite:

        /**
         * Read a specific customer
         */
        public void testReadSingle() throws Exception {

            // Create and initialize command to read customers
            DAS das = DAS.FACTORY.createDAS(getConnection());
            Command readCustomers = das.createCommand("select * from
    CUSTOMER where ID = 1");

            // Read
            DataObject root = readCustomers.executeQuery();

            // Verify
            assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
        }

Notice that this example also does not allow parameterized queries.  I 
would make this simplifying assumption to get something up and running.

I cannot help with the C++ equivalent of JDBC Connection but I am sure 
there is something similar available.

--
Kevin



Adriano Crestani wrote:

> 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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
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 <ke...@qwest.net> 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: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Kevin Williams <ke...@qwest.net>.
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Adriano Crestani <ad...@gmail.com>.
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 <do...@gmail.com> wrote:
>
> Ok, I´ll help you to solve the compiler erros of these classes.
>
> On 2/8/07, Willian Yabusame Maja <wi...@hotmail.com> wrote:
> >
> > I could help to implement some of these classes.
> >
> > ----- Original Message -----
> > From: "Adriano Crestani" <ad...@gmail.com>
> > To: <tu...@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: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Douglas Leite <do...@gmail.com>.
Ok, I´ll help you to solve the compiler erros of these classes.

On 2/8/07, Willian Yabusame Maja <wi...@hotmail.com> wrote:
>
> I could help to implement some of these classes.
>
> ----- Original Message -----
> From: "Adriano Crestani" <ad...@gmail.com>
> To: <tu...@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: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Willian Yabusame Maja <wi...@hotmail.com>.
I could help to implement some of these classes.

----- Original Message ----- 
From: "Adriano Crestani" <ad...@gmail.com>
To: <tu...@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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [DAS C++] Necessary classes for a initial simple read application

Posted by Dannyel Fonseca <da...@gmail.com>.
I'm at disposal. You suggest some division? Or we go making everything
together?

2007/2/8, Adriano Crestani <ad...@gmail.com>:
>
> 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
>