Firefox Javascript <-> DB

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guillaume CABANAC

    Firefox Javascript <-> DB

    Hi everybody,

    Does anybody know how to access a remote database (say Oracle) from
    JavaScript code (within a Firefox Extension) ?

    I know ADO via ActiveX in the IE world and think a similar thing exists
    in Firefox.

    Thanks a lots,

    Guillaume from France


  • Martin Honnen

    #2
    Re: Firefox Javascript &lt;-&gt; DB



    Guillaume CABANAC wrote:
    [color=blue]
    > Does anybody know how to access a remote database (say Oracle) from
    > JavaScript code (within a Firefox Extension) ?[/color]

    I googled and found
    <http://eu.mozdev.org/Brussels2003/talks/jan/index.html>
    I am not sure whether that is about a local or a remote database.

    --

    Martin Honnen

    Comment

    • Terriblecow

      #3
      Re: Firefox Javascript &lt;-&gt; DB

      There has been a lot of progress lately in getting javascript to talk
      to a server.

      In the past projects such as JSRS
      (http://sourceforge.net/projects/js-rs) were helpful by providing a
      cross browser solution to contacting a server and retrieving info
      through javascript. I've found it very useful, and it's a good
      starting point.
      JSRS Abstract:
      JavaScript Remote Scripting Transfer Javascript data without reloading
      the webpage. Call functions or methods on the server through
      Javascript. Works without the use of any Java nor plugins. Supports
      NS6.2, IE5.5 and up. Parameters passing is wrapped.


      Another great solution, but it's not completely browser independent, is
      the XMLHTTPRequest object. This has become more popular for a lot of
      reasons. It's easier to use, implements XML to relay data, and it is
      supported by most browsers (not opera or konquerer that I know of).
      However, the XMLHTTPRequest object is becoming more standard and
      accepted (opera will support it in version 8.0)

      One of the reasons why this has started to become more popular, believe
      it or not, is that Google is starting to use it in their online apps.
      Gmail (http://www.gmail.com), Google suggest
      (http://www.google.com/webhp?complete=1&hl=en), and Google
      Maps(http://maps.google.com) use it as core function. It's some pretty
      cool stuff.

      The XMLHTTTP object is designed to be given a url and callback
      function. Then once the call to the server is made and a response is
      retrieved by the browser the callback function is executed. I've found
      a few good sites that go into detail and have some good examples.







      One more solution that may be worth looking into is the XML for
      <script> open source project (http://xmljs.sourceforge.net/). This
      project was mainly developed to provide the XML Document Object Model
      for javascript, but it has some other functionality that allows talk
      back and forth to a server from within the javascript framework.

      I prefer using a mix of the all three approaches in using javasccript
      to get data from a server. I enjoy the XML Document Object Model that
      is available with the XMLHTTP object, but I can't sacrifice the browser
      compatibility support that JSRS affords. So nice mix works pretty
      well.

      I hope this is what you're looking for. I didn't post any code
      snippets since the links I've given do a much better job.

      I think this info should get you started.

      Good Luck

      Comment

      • Guillaume CABANAC

        #4
        Re: Firefox Javascript &lt;-&gt; DB

        Thanks a lot for having spent time answering ! Usenet is really an
        efficient way to learn from people.

        I would like to build an application that would allow users to see and
        post annotations on web documents. So I thought I could code :
        - the project's functionnal core in Java (provide services hidding
        the DB connexion : getAnnotation, setAnnotation.. .)
        - javaScript code for presentation : asks the java code when a page
        is loaded by the browser, retrieve annotations and insert then into the html
        file using DOM + CSS

        As far as I can see, I can
        - retrieve IE browser events from javascript
        - warp my Java core in a home made ActiveX in my JavaScript code
        (with Sun's Java-ActiveX bridge)

        a schema may help you understand my proposal:

        DB <-- JDBC --> Java functionnal core <-- ActiveX --> JavaScript <-- events,
        DOM, CSS --> MSInternet Explorer

        The only problem : it is too complex and may be simplified with
        XMLHTTPRequest ??? What do you think about it ?

        Thanks, Guillaume


        "Terribleco w" <terriblecow@gm ail.com> a écrit dans le message de news:
        1111508970.6256 47.125300@o13g2 00...legr oups.com...[color=blue]
        > There has been a lot of progress lately in getting javascript to talk
        > to a server.
        >
        > In the past projects such as JSRS
        > (http://sourceforge.net/projects/js-rs) were helpful by providing a
        > cross browser solution to contacting a server and retrieving info
        > through javascript. I've found it very useful, and it's a good
        > starting point.
        > JSRS Abstract:
        > JavaScript Remote Scripting Transfer Javascript data without reloading
        > the webpage. Call functions or methods on the server through
        > Javascript. Works without the use of any Java nor plugins. Supports
        > NS6.2, IE5.5 and up. Parameters passing is wrapped.
        >
        >
        > Another great solution, but it's not completely browser independent, is
        > the XMLHTTPRequest object. This has become more popular for a lot of
        > reasons. It's easier to use, implements XML to relay data, and it is
        > supported by most browsers (not opera or konquerer that I know of).
        > However, the XMLHTTPRequest object is becoming more standard and
        > accepted (opera will support it in version 8.0)
        >
        > One of the reasons why this has started to become more popular, believe
        > it or not, is that Google is starting to use it in their online apps.
        > Gmail (http://www.gmail.com), Google suggest
        > (http://www.google.com/webhp?complete=1&hl=en), and Google
        > Maps(http://maps.google.com) use it as core function. It's some pretty
        > cool stuff.
        >
        > The XMLHTTTP object is designed to be given a url and callback
        > function. Then once the call to the server is made and a response is
        > retrieved by the browser the callback function is executed. I've found
        > a few good sites that go into detail and have some good examples.
        >
        > http://webfx.eae.net/dhtml/xmlextras/xmlextras.html
        >
        > http://www.adaptivepath.com/publicat...ves/000385.php
        >
        > http://jibbering.com/2002/4/httprequest.html
        >
        > One more solution that may be worth looking into is the XML for
        > <script> open source project (http://xmljs.sourceforge.net/). This
        > project was mainly developed to provide the XML Document Object Model
        > for javascript, but it has some other functionality that allows talk
        > back and forth to a server from within the javascript framework.
        >
        > I prefer using a mix of the all three approaches in using javasccript
        > to get data from a server. I enjoy the XML Document Object Model that
        > is available with the XMLHTTP object, but I can't sacrifice the browser
        > compatibility support that JSRS affords. So nice mix works pretty
        > well.
        >
        > I hope this is what you're looking for. I didn't post any code
        > snippets since the links I've given do a much better job.
        >
        > I think this info should get you started.
        >
        > Good Luck
        >[/color]


        Comment

        • Dave Cook

          #5
          Re: Firefox Javascript &lt;-&gt; DB

          On 2005-03-21, Martin Honnen <mahotrash@yaho o.de> wrote:
          [color=blue]
          > I googled and found
          > <http://eu.mozdev.org/Brussels2003/talks/jan/index.html>
          > I am not sure whether that is about a local or a remote database.[/color]

          According to that old talk, they only had Postgres support. They have MySQL
          and SQLite working now, but I believe you still have to recompile the
          browser, which just seems so 90s to me. There's also another project to
          unify Mozilla database service code using SQLite3 (mozStorage). Too bad
          about the duplication of effort. mozStorage is described in this bug
          report:

          RESOLVED (nobody) in Core - SQLite and Embedded Database Bindings. Last updated 2024-08-20.


          Dave Cook

          Comment

          Working...