Thread: Sun J2SE 1.4 + postgresql-jdbc3-7.3.jar + Postgresql 7.2.1 and getParameterMetaData() fail

Hi,

I'm newbie to PostgreSQL + Java + All :)

All seems to run fine, but the getParameterMetaData() do not.

The envinronment is:

private PreparedStatement updStmt;
String upd = "UPDATE AnswerTable SET pnformid = ?, pnuserid = ? WHERE pnanswerid = ? ";
updStmt = connection.prepareStatement(upd);

I have a function:

int numParameters = updStmt.getParameterMetaData().getParameterCount();

and it fails when i call it.

The e.getMessage() is

    "This method is not yet implemented."

when i run it with java version "1.4.1_01".

With java version "1.3.1_07" i just get "NoSuchMethodError".

Plz, can anyone help me or indicate what could be wrong?

Regards,

--
Joel Franco Guzmán
Infrastructure Manager
3WT - Wireless Web World Tech
joel.franco@3WT.com.br
tel: +55 16 3362-3905
fax: +55 16 3371-9847
cel: +55 16 9787-0478

Re: Sun J2SE 1.4 + postgresql-jdbc3-7.3.jar + Postgresql

From
Dave Cramer
Date:
Joel,

We don't support all of jdbc3 methods yet. we do accept patches for them
though ;)

Dave
On Wed, 2003-02-26 at 22:42, Joel Franco Guzmán wrote:
> Hi,
>
> I'm newbie to PostgreSQL + Java + All :)
>
> All seems to run fine, but the getParameterMetaData() do not.
>
> The envinronment is:
>
> private PreparedStatement updStmt;
> String upd = "UPDATE AnswerTable SET pnformid = ?, pnuserid = ? WHERE pnanswerid = ? ";
> updStmt = connection.prepareStatement(upd);
>
> I have a function:
>
> int numParameters = updStmt.getParameterMetaData().getParameterCount();
>
> and it fails when i call it.
>
> The e.getMessage() is
>
>     "This method is not yet implemented."
>
> when i run it with java version "1.4.1_01".
>
> With java version "1.3.1_07" i just get "NoSuchMethodError".
>
> Plz, can anyone help me or indicate what could be wrong?
>
> Regards,
--
Dave Cramer <Dave@micro-automation.net>


Re: Sun J2SE 1.4 + postgresql-jdbc3-7.3.jar + Postgresql 7.2.1

From
Barry Lind
Date:
Joel,

The error message in this case is actually pretty good.  The
getParameterMetaData() method is not implemented in the postgres jdbc
driver.  I think you are the first person that has requested it.  Might
I ask what you are trying to do, that requires this method?

The error message you get with jdk 1.3.1 is because this method is a new
method in java 1.4 and didn't exist in 1.3 or earlier.

thanks,
--Barry





Joel Franco Guzmán wrote:
> Hi,
>
> I'm newbie to PostgreSQL + Java + All :)
>
> All seems to run fine, but the getParameterMetaData() do not.
>
> The envinronment is:
>
> private PreparedStatement updStmt;
> String upd = "UPDATE AnswerTable SET pnformid = ?, pnuserid = ? WHERE pnanswerid = ? ";
> updStmt = connection.prepareStatement(upd);
>
> I have a function:
>
> int numParameters = updStmt.getParameterMetaData().getParameterCount();
>
> and it fails when i call it.
>
> The e.getMessage() is
>
>     "This method is not yet implemented."
>
> when i run it with java version "1.4.1_01".
>
> With java version "1.3.1_07" i just get "NoSuchMethodError".
>
> Plz, can anyone help me or indicate what could be wrong?
>
> Regards,
>