By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,628 Members | 1,723 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,628 IT Pros & Developers. It's quick & easy.

Firefox Javascript <-> DB

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a


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


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
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

P: n/a
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

Jul 23 '05 #3

P: n/a
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
"Terriblecow" <te*********@gmail.com> a écrit dans le message de news:
11**********************@o13g2000cwo.googlegroups. com...
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

Jul 23 '05 #4

P: n/a
On 2005-03-21, Martin Honnen <ma*******@yahoo.de> wrote:
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.


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:

https://bugzilla.mozilla.org/show_bug.cgi?id=261861

Dave Cook
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.