Re: pgsql jdbc db connection weird behaviour

Поиск
Список
Период
Сортировка
От Steven Schlansker
Тема Re: pgsql jdbc db connection weird behaviour
Дата
Msg-id 078EE923-CCF6-45FA-B0EB-C18FC42C0D5B@gmail.com
обсуждение исходный текст
Ответ на pgsql jdbc db connection weird behaviour  (Venkateswar Reddy Melachervu <vmelachervu@gmail.com>)
Ответы Re: pgsql jdbc db connection weird behaviour
Список pgsql-jdbc
On Mar 30, 2014, at 12:10 AM, Venkateswar Reddy Melachervu <vmelachervu@gmail.com> wrote:

> Hello PGSQL Community,
> Love pgsql. But facing this weird problem (detailed below) for past couple of days with pgsql jdbc41 driver with
tomcat8 connection pooling on on jvm1.8 (all on x64 windows 8) with no resolution in sight for casting a jdbc db tomcat
pooledconnection to PGConnection hitting the wall.  
>
> I am sure not sure if I am doing something silly or it is the limitation of pgsql jdbc41 driver. Did any one face any
suchissue? Does any one know some way out for this? 
>
> Problem:
> When I try to cast a DB Connection obtained using tomcat jdbc resource (pooled) to org.postgresql.PGConnection, of
courseafter unwrapping it, execution is running into exception with the message: (java.lang.ClassCastException)
java.lang.ClassCastException:org.postgresql.jdbc4.Jdbc4Connection cannot be cast to org.postgresql.PGConnection 

Almost always this is caused by having more than one driver jar file available in your class path.  In particular,
bundlinga driver in the Tomcat lib/ directory as well as within your application itself is sure to cause problems. 

That’s where I would look first.

Hope that helps,
Steven



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Venkateswar Reddy Melachervu
Дата:
Сообщение: pgsql jdbc db connection weird behaviour
Следующее
От: Venkateswar Reddy Melachervu
Дата:
Сообщение: Re: pgsql jdbc db connection weird behaviour