You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by lenin <le...@gmail.com> on 2012/09/18 12:47:45 UTC

How to connect CouchDB from Tomcat with jquery not any javaProgram

How to connect CouchDB from Tomcat with  jquery not any javaProgram.
How to do
Please explain it to implement with JQuery
Thanks in advance



--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Robert Newson <ro...@gmail.com>.
Please use the user mailing list not the dev list.

Sent from the ocean floor

On 8 Oct 2012, at 11:33, lenin <le...@gmail.com> wrote:

> how to configure reverser proxy setting in tomcat 6.0 for couchdb
>
>
>
> --
> View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581198.html
> Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
how to configure reverser proxy setting in tomcat 6.0 for couchdb



--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581198.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
How to configure proxy in tomcat web server to connect couchdb to 
run my web application  on tomcat webserver


Regards
G.Lenin




--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581197.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Simon Metson <si...@cloudant.com>.
Hi Lenin, 
You can either set Tomcat up as a reverse proxy (I think): http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html 

Or set up httpd/nginx:
http://wiki.apache.org/couchdb/Apache_As_a_Reverse_Proxy
http://wiki.apache.org/couchdb/Nginx_As_a_Reverse_Proxy

If you go the second route you'll need to have tomcat behind the proxy, too.
Cheers
Simon


On Thursday, 4 October 2012 at 10:17, lenin wrote:

> how to do without reverse proxy?
> can u give a code to do that....
> 
> 
> 
> --
> View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581161.html
> Sent from the CouchDB Development mailing list archive at Nabble.com (http://Nabble.com).
> 
> 



Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Ruben LZ Tan <so...@gmail.com>.
What are you using as a host? Is it your own server? An AWS instance?

Thanks,
Ruben Tan


On Thursday, October 4, 2012 at 5:31 PM, lenin wrote:

> what is the way to achieve my goal....
> 
> 
> 
> 
> --
> View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581165.html
> Sent from the CouchDB Development mailing list archive at Nabble.com (http://Nabble.com).
> 
> 



Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 4 October 2012 11:31, lenin <le...@gmail.com> wrote:
> what is the way to achieve my goal....

Hi Lenin,

> How to connect CouchDB from Tomcat with  jquery not any javaProgram.

I suspect there's a bit of a gap between your aspirations, & your
understanding of the components. Apologies if I'm wrong, coz this
email is not intended to come across as a complete arse.

CouchDB is a database that's accessible *only* over HTTP -- i.e. it
includes its own webserver. You can run your own couch, or use a
hosted one, but in any case your application running in Tomcat or
where-ever will need to be able to access CouchDB over HTTP.

JQuery is a framework that runs inside web browsers. You can get your
jquery stuff to talk directly to couchdb (which is what the futon
admin interface does). And as CouchDB serves HTTP as well, you can
embed your HTML files (jquery.js, index.html & all the rest) inside a
CouchDB Design Document, so that the database access & the web served
files come from the same Origin. This is very handy.

Given all that, I don't see why you want to include Tomcat in the mix.
Unless you have some cool Java Beans stuff to do in which case it
probably makes lots of sense. But then you need to tell us about that
too.

If you *do* need Tomcat, then you need to decide if your front end
jquery code running in the browser *really* needs to talk to the Couch
database via Tomcat. You'll be serialising & reinstantiating the JSON
docs out of CouchDB unnecessarily even before you do any actual
processing in Tomcat. It will be much faster to have the browser talk
to couchdb directly.

So where to now?

- ditch tomcat & keep things simple
- clarify what you want to do with tomcat & you're probably better off
asking that on a tomcat list

If you are a Java person then ektorp is pretty popular library for
talking to CouchDB.

A+
Dave

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
what is the way to achieve my goal....




--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581165.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Ruben LZ Tan <so...@gmail.com>.
I'm not really a sys admin so I'm not so sure of the exact way to do it, unfortunately. But just think of CouchDB as a webserver. You put CouchDB in say, a AWS instance, and you can connect to it locally, right? Via curl and such. Now you have your app in another server, how do you access your CouchDB? You can't, because there's no way to reach it since the CouchDB "server" only exists in that AWS instance. If I understand this correctly, you can expose a port in your AWS instance to redirect to your CouchDB's port, which will then allow you to access it from anywhere in the world using curl or browser.

Not sure if this helps. I am terrible at explaining stuff like this. :/ 

Thanks,
Ruben Tan


On Thursday, October 4, 2012 at 5:17 PM, lenin wrote:

> how to do without reverse proxy?
> can u give a code to do that....
> 
> 
> 
> --
> View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581161.html
> Sent from the CouchDB Development mailing list archive at Nabble.com (http://Nabble.com).
> 
> 



Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
how to do without reverse proxy?
can u give a code to do that....



--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581161.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
how to do without reverse proxy?
can u give the code to do that.... 



--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581162.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Ruben LZ Tan <so...@gmail.com>.
Well one way is to expose your CouchDB to the internet (through a reverse proxy or something). This way you can easily access your server through the browser, and since you can do that, connecting to it via java or jquery is as simple as just calling its REST api directly.

Thanks,
Ruben Tan


On Thursday, October 4, 2012 at 4:54 PM, lenin wrote:

> I'm writing a CouchDB sample. My intention is to write a web app using AJAX
> and deploy it in the tomcat environment. As I use the CouchDB I would like
> to know the way to interact with the CouchDB server.
> 
> 1) As my application is deployed in a web server(Tomcat) is it possible to
> connect with a CouchDB outside? Many examples uses apps which are deployed
> in CouchApp or Couch environment itself.
> 
> 
> 
> --
> View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581159.html
> Sent from the CouchDB Development mailing list archive at Nabble.com (http://Nabble.com).
> 
> 



Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by lenin <le...@gmail.com>.
I'm writing a CouchDB sample. My intention is to write a web app using AJAX
and deploy it in the tomcat environment. As I use the CouchDB I would like
to know the way to interact with the CouchDB server.

1) As my application is deployed in a web server(Tomcat) is it possible to
connect with a CouchDB outside? Many examples uses apps which are deployed
in CouchApp or Couch environment itself.



--
View this message in context: http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919p7581159.html
Sent from the CouchDB Development mailing list archive at Nabble.com.

Re: How to connect CouchDB from Tomcat with jquery not any javaProgram

Posted by Octavian Damiean <ma...@gmail.com>.
Could be please try to be a bit more precise.

What exactly are you trying to achieve and what have you tried so far?

Cheers,
Octavian

On Tue, Sep 18, 2012 at 12:47 PM, lenin <le...@gmail.com> wrote:

> How to connect CouchDB from Tomcat with  jquery not any javaProgram.
> How to do
> Please explain it to implement with JQuery
> Thanks in advance
>
>
>
> --
> View this message in context:
> http://couchdb-development.1959287.n2.nabble.com/How-to-connect-CouchDB-from-Tomcat-with-jquery-not-any-javaProgram-tp7580919.html
> Sent from the CouchDB Development mailing list archive at Nabble.com.
>