Webview and databases

  • Hi everybody,

    I have the goal to show all the results of a query to a database of
    mine into an HTML document containing a table.
    I don't know where to start to do this rather simple thing; have I to
    deal with XML or DOMs ?
    Please help me a little bit because I've no great experience in HTML...

    Many thanks.
    --
    Sanri Parov

    The UNIX Guru's view of sex:
    unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep
  • On Oct 15, 2005, at 10:03 AM, Sanri Parov wrote:

    > I have the goal to show all the results of a query to a database of
    > mine into an HTML document containing a table.
    > I don't know where to start to do this rather simple thing; have I
    > to deal with XML or DOMs ?
    > Please help me a little bit because I've no great experience in
    > HTML...

    If you do not need this to be embedded into some other application,
    and are willing to just browse to a server, you might want to look
    into WebObjects.  It has a quite cocoa-like feel, even though it is
    written in Java.  (If you are willing to write in Java, you have many
    other options, like Spring/Hibernate, Tapestry/Cayenne, etc., but
    that is not really an option for Cocoa folk.)

    If you do want to show this output as part of a Cocoa program, then
    you need to divide the problem into three steps:  get data from
    database, generate html from it, and show it to the user.  The first
    depends on your database - mysql has tools, and SqlLite's maker
    offers a library for db access.  The second is often best done via a
    few routines to hand-roll the HTML.  The third is best done by
    putting together a webkit view, and pushing the data into a Webkit view.

    Scott
  • Il giorno 15/ott/05, alle ore 21:22, Scott Ellsworth ha scritto:

    > SqlLite's maker offers a library for db access.  The second is
    > often best done via a few routines to hand-roll the HTML.  The
    > third is best done by putting together a webkit view, and pushing
    > the data into a Webkit view.
    >
    > Scott

    Many thanks Scott.
    as far as I'm using Sqlite 2.8 , is there some useful helping routine
    for this?
    Can you give me some good starting point?
    Thanks again.

    --
    Sanri Parov

    The UNIX Guru's view of sex:
    unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep
  • On 10/15/05 8:03 PM, "Sanri Parov" <sanri.parov...> wrote:

    > Hi everybody,
    >
    > I have the goal to show all the results of a query to a database of
    > mine into an HTML document containing a table.
    > I don't know where to start to do this rather simple thing; have I to
    > deal with XML or DOMs ?
    > Please help me a little bit because I've no great experience in HTML...
    >
    > Many thanks.

    Hi Sanri,

    You need also tell what API you want to use to access database and generate
    HTML.

    Millions sites do this using Apache + PHP + some db


    --
    Best regards,

    Ruslan Zasukhin
    VP Engineering and New Technology
    Paradigma Software, Inc

    Valentina - Joining Worlds of Information
    http://www.paradigmasoft.com

    [I feel the need: the need for speed]
  • On 10/16/05 2:42 AM, "Sanri Parov" <sanri.parov...> wrote:

    >
    > Il giorno 15/ott/05, alle ore 21:22, Scott Ellsworth ha scritto:
    >
    >> SqlLite's maker offers a library for db access.  The second is
    >> often best done via a few routines to hand-roll the HTML.  The
    >> third is best done by putting together a webkit view, and pushing
    >> the data into a Webkit view.
    >>
    >> Scott
    >
    > Many thanks Scott.
    > as far as I'm using Sqlite 2.8 , is there some useful helping routine
    > for this?
    > Can you give me some good starting point?
    > Thanks again.

    Actually no problems here:

    For ANY db steps in PHP are:

    * get cursor as result of query

    * loop by records

        print "<tr>"

        * loop by fields

            print "<td>" . Field value . "</td>"

        print "<tr>"

    --
    Best regards,

    Ruslan Zasukhin
    VP Engineering and New Technology
    Paradigma Software, Inc

    Valentina - Joining Worlds of Information
    http://www.paradigmasoft.com

    [I feel the need: the need for speed]
  • On Oct 15, 2005, at 4:42 PM, Sanri Parov wrote:

    >
    > Il giorno 15/ott/05, alle ore 21:22, Scott Ellsworth ha scritto:
    >
    >> SqlLite's maker offers a library for db access.  The second is
    >> often best done via a few routines to hand-roll the HTML.  The
    >> third is best done by putting together a webkit view, and pushing
    >> the data into a Webkit view.
    >>
    >> Scott
    >
    > Many thanks Scott.
    > as far as I'm using Sqlite 2.8 , is there some useful helping
    > routine for this?
    > Can you give me some good starting point?
    > Thanks again.

    Best I can offer is the sqlite site itself.  It is made for
    embedding, and has a C api.  See <http://www.sqlite.org/capi3.html>,
    which mentions the pre-existing sqlite 2 API in passing.

    My own use of sqlite is all through Core Data, so I have not had to
    actually call C api functions myself.  The times I have actually had
    to hit the database directly, parse sql and result sets, and the
    like, has all been on the Java side.  Nowadays, I use frameworks like
    Hibernate or WebObjects, as they write pretty good sql, and are a lot
    easier to drop in.

    Scott