Thread: Program accessing database via servlet

Program accessing database via servlet

From
zhang-lan@usa.net
Date:
Hi, all.

I am having a problem when accessing the postgresql database via servlet. I
set up a java web server (Win 95), and my servlet program need to access the
remote postgresql database which is not on my server. When the program
executed   DriverManager.getConnection(dburl, user, passwd),
it shows the error: java.lang.IllegalArgumentException: Argument # > Arg
length

But the similar program which I don't use servlet runs ok, it can access the
remote database very well. I don't know why. And if I change the database to
the MS Access database which is on my machine, the servlet program also runs
fine.

Anyone can help?

Thanks.

Lan Zhang


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1


Re: [INTERFACES] Program accessing database via servlet

From
Anders Svensson
Date:
I had the samme problem on my system (mac > linux).

Make sure that you, if you load the dburl, usr and password from a file,
removes ANY tailing spaces.

If you get the the same error try to hard-code the dburl,usr and password
into your program (during debuging).



Simu Soft
v/Anders Svensson
Frederikssundsvej 20, 2 th
DK-2400  København NV

e-mail     : Anders@simusoft.dk
tlf.    : +45 3583 8126



Re: [INTERFACES] Program accessing database via servlet

From
Jens Glaser
Date:
Hi,

On 1 Oct 1999 zhang-lan@usa.net wrote:
> I am having a problem when accessing the postgresql database via servlet. I
>[..]
>     DriverManager.getConnection(dburl, user, passwd),
> it shows the error: java.lang.IllegalArgumentException: Argument # > Arg
> length

This might actually be a misleading error message generated by an old JDBC
version. Try the newest JDBC driver first (from the CVS).

It *should* return you the correct error message then which I guess
is something like "wrong username/password" or so in your case!

Kind regards,

-- 
Jens Glaser     Am Holderstrauch 13, 36041 Fulda, 0661/9429507    jens@jens.de



Re: [INTERFACES] Program accessing database via servlet

From
Richard Morrell
Date:
On 1 Oct 1999 zhang-lan@usa.net wrote:

> I am having a problem when accessing the postgresql database via servlet. I
> set up a java web server (Win 95), and my servlet program need to access the
> remote postgresql database which is not on my server. When the program
> executed
>     DriverManager.getConnection(dburl, user, passwd),
> it shows the error: java.lang.IllegalArgumentException: Argument # > Arg
> length

I got this problem when I used the old 6.5.1 jdbc driver.  Switching to
the new 6.5.2 driver fixed the problem for me.
--
Richard Morrell                                           richard@ednet.co.uk
Operations Manager - edNET: InternetWorkingSolutions - http://www.ednet.co.uk