Thread: persistent JDBC connections with a daemon

persistent JDBC connections with a daemon

From
Eric Frazier
Date:
Hi,

I have a very small Java application that connects to a remote host's DB and
does a simple query. I don't want to install a big framwork like Tomcat just
to do this one task, but it is pretty slow as it is running though a CGI
wrapper, and the startup time of the JVM is pretty noticeable.

I do know that there is a daemon tools project from the Jakarta project, and
that there is also a Posix libary for Java. But I can't seem to find an
example of anyone acutlay using those to make a java daemon. The whole
reason I am using Java at all is because of JDBC, I tend to think that Java
itself can take a flying leap, except that I just drool over JDBC, love it,
love it! So if any of you have any pointers or URLs that would be great.


Thanks,


Eric

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant





Re: persistent JDBC connections with a daemon

From
Simon Mitchell
Date:
Hi,
       This may not help you at all but this artical talks about
*Compiling Java with GCJ.*
Which improves performance.

http://www.linuxjournal.com/article.php?sid=4860


Eric Frazier wrote:

>Hi,
>
>I have a very small Java application that connects to a remote host's DB and
>does a simple query. I don't want to install a big framwork like Tomcat just
>to do this one task, but it is pretty slow as it is running though a CGI
>wrapper, and the startup time of the JVM is pretty noticeable.
>
>I do know that there is a daemon tools project from the Jakarta project, and
>that there is also a Posix libary for Java. But I can't seem to find an
>example of anyone acutlay using those to make a java daemon. The whole
>reason I am using Java at all is because of JDBC, I tend to think that Java
>itself can take a flying leap, except that I just drool over JDBC, love it,
>love it! So if any of you have any pointers or URLs that would be great.
>
>
>Thanks,
>
>
>Eric
>
>(250) 655 - 9513 (PST Time Zone)
>
>"Inquiry is fatal to certainty." -- Will Durant
>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>



Re: persistent JDBC connections with a daemon

From
Dave Cramer
Date:
Eric,

Just create a class, put a main in it, and loop forever?

That's all there is to it, unless I'm missing something.

Dave
On Sat, 2003-01-11 at 14:59, Eric Frazier wrote:
> Hi,
>
> I have a very small Java application that connects to a remote host's DB and
> does a simple query. I don't want to install a big framwork like Tomcat just
> to do this one task, but it is pretty slow as it is running though a CGI
> wrapper, and the startup time of the JVM is pretty noticeable.
>
> I do know that there is a daemon tools project from the Jakarta project, and
> that there is also a Posix libary for Java. But I can't seem to find an
> example of anyone acutlay using those to make a java daemon. The whole
> reason I am using Java at all is because of JDBC, I tend to think that Java
> itself can take a flying leap, except that I just drool over JDBC, love it,
> love it! So if any of you have any pointers or URLs that would be great.
>
>
> Thanks,
>
>
> Eric
>
> (250) 655 - 9513 (PST Time Zone)
>
> "Inquiry is fatal to certainty." -- Will Durant
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
--
Dave Cramer <Dave@micro-automation.net>


Re: persistent JDBC connections with a daemon

From
Eric Frazier
Date:
Hi,

Comunicating with the outside world(UNIX) is what you would be missing, that
is what Posix is about. But I was finding it a little daunting.  I have to
be able to send to or pipe to it from shell applications, but once you run a
normal app like you suggest, it gets its args[] and then how do you change
them for the next query?

thanks,

Eric

At 07:01 PM 1/11/03 -0500, Dave Cramer wrote:
>Eric,
>
>Just create a class, put a main in it, and loop forever?
>
>That's all there is to it, unless I'm missing something.
>
>Dave
>On Sat, 2003-01-11 at 14:59, Eric Frazier wrote:
>> Hi,
>>
>> I have a very small Java application that connects to a remote host's DB and
>> does a simple query. I don't want to install a big framwork like Tomcat just
>> to do this one task, but it is pretty slow as it is running though a CGI
>> wrapper, and the startup time of the JVM is pretty noticeable.
>>
>> I do know that there is a daemon tools project from the Jakarta project, and
>> that there is also a Posix libary for Java. But I can't seem to find an
>> example of anyone acutlay using those to make a java daemon. The whole
>> reason I am using Java at all is because of JDBC, I tend to think that Java
>> itself can take a flying leap, except that I just drool over JDBC, love it,
>> love it! So if any of you have any pointers or URLs that would be great.
>>
>>
>> Thanks,
>>
>>
>> Eric
>>
>> (250) 655 - 9513 (PST Time Zone)
>>
>> "Inquiry is fatal to certainty." -- Will Durant
>>
>>
>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 5: Have you checked our extensive FAQ?
>>
>> http://www.postgresql.org/users-lounge/docs/faq.html
>--
>Dave Cramer <Dave@micro-automation.net>
>

(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant





Re: persistent JDBC connections with a daemon

From
Dave Cramer
Date:
Three options that I am aware of:

1)reading from stdin works, or
2)open a tcpip port and do request through that.
3)modify a file, and signal it (never done this, but I think it works)

Dave

On Sat, 2003-01-11 at 16:39, Eric Frazier wrote:
> Hi,
>
> Comunicating with the outside world(UNIX) is what you would be missing, that
> is what Posix is about. But I was finding it a little daunting.  I have to
> be able to send to or pipe to it from shell applications, but once you run a
> normal app like you suggest, it gets its args[] and then how do you change
> them for the next query?
>
> thanks,
>
> Eric
>
> At 07:01 PM 1/11/03 -0500, Dave Cramer wrote:
> >Eric,
> >
> >Just create a class, put a main in it, and loop forever?
> >
> >That's all there is to it, unless I'm missing something.
> >
> >Dave
> >On Sat, 2003-01-11 at 14:59, Eric Frazier wrote:
> >> Hi,
> >>
> >> I have a very small Java application that connects to a remote host's DB and
> >> does a simple query. I don't want to install a big framwork like Tomcat just
> >> to do this one task, but it is pretty slow as it is running though a CGI
> >> wrapper, and the startup time of the JVM is pretty noticeable.
> >>
> >> I do know that there is a daemon tools project from the Jakarta project, and
> >> that there is also a Posix libary for Java. But I can't seem to find an
> >> example of anyone acutlay using those to make a java daemon. The whole
> >> reason I am using Java at all is because of JDBC, I tend to think that Java
> >> itself can take a flying leap, except that I just drool over JDBC, love it,
> >> love it! So if any of you have any pointers or URLs that would be great.
> >>
> >>
> >> Thanks,
> >>
> >>
> >> Eric
> >>
> >> (250) 655 - 9513 (PST Time Zone)
> >>
> >> "Inquiry is fatal to certainty." -- Will Durant
> >>
> >>
> >>
> >>
> >>
> >> ---------------------------(end of broadcast)---------------------------
> >> TIP 5: Have you checked our extensive FAQ?
> >>
> >> http://www.postgresql.org/users-lounge/docs/faq.html
> >--
> >Dave Cramer <Dave@micro-automation.net>
> >
>
> (250) 655 - 9513 (PST Time Zone)
>
> "Inquiry is fatal to certainty." -- Will Durant
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
--
Dave Cramer <Dave@micro-automation.net>