import com.sybase.jdbc2.jdbc.SybConnectionPoolDataSource;
import com.sybase.jdbc2.jdbc.SybDataSource;
for pooled connections. But when I tried to get the connection, I got the
following exception. If I dont "chain" the two DS, I can get Connection via
ConnectionPoolDataSource.getPooledConnection().getConnection() fine.
Please help.
********************
java.sql.SQLException: JZ006: Caught IOException:
java.net.UnknownHostException: null
at
com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:485)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:2961)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:339)
at
com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213)
at
com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:193)
at
com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:172)
at
com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:124)
at
com.sybase.jdbc2.jdbc.SybDriver.createConnection(SybDriver.java:533)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:473)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:505)
at
com.sybase.jdbc2.jdbc.SybDataSource.getConnection(SybDataSource.java:217)
Any idea why?
*************
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): serverHost: >null<
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): serverPort: >-1<
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): login: host = 'null',
port = '-1'
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]): loading Converter:
com.sybase.jdbc2.utils.PureConverter
com.sybase.jdbc2.timedio.InStreamMgr(Thread[Thread-0,5,main]): Connecting to
'null:-1', timeout = 0ms
(Thread[Thread-0,5,main]): Dbio.connect - new RawDbio
com.sybase.jdbc2.timedio.RawDbio(Thread[Thread-0,5,main]): new RawDbio
com.sybase.jdbc2.timedio.RawDbio(Thread[Thread-0,5,main]): attempting
connection to null:-1, retry # 0
com.sybase.jdbc2.tds.Tds(Thread[Thread-0,5,main]):
java.net.UnknownHostException: null
java.net.UnknownHostException: null
at java.net.InetAddress.getAllByName0(InetAddress.java:566)
at java.net.InetAddress.getAllByName0(InetAddress.java:535)
at java.net.InetAddress.getByName(InetAddress.java:444)
at java.net.Socket.<init>(Socket.java:95)
at com.sybase.jdbc2.timedio.RawDbio.doConnect(RawDbio.java:88)
at com.sybase.jdbc2.timedio.InStreamMgr.<init>(InStreamMgr.java:94)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:307)
at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:213)
at
com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:193)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:172)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:124)
at com.sybase.jdbc2.jdbc.SybDriver.createConnection(SybDriver.java:533)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:473)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:505)
at
com.sybase.jdbc2.jdbc.SybDataSource.getConnection(SybDataSource.java:249)
"sybase user" <bys...@hotmail.com> wrote in message
news:VUxgpZB...@forums.sybase.com...
set example 11-3 and 11-4 from the JDBC 3.0 spec for a good
overview.
The problem appears to be SybDataSource, which I was guessing is some sort
of PooledDataSource so I made a binding of that, with the previously binded
ConnectionPoolDataSource as the datasource this time. It looked like
SybDataSource is not a PooledDataSource therefore it doesn't know how to use
the supplied datasource via JNDI. Perhaps Sybase expects the user to
implement our own pooling by using the hooks in ConnectionPoolDataSource?
<lance.a...@sun.com> wrote in message
news:E01640D43EF8D1A50057466485256BC7.00554CC085256BC7@webforums...
Are you saying that, by getting
SybConnectionPoolDataSource.getPooledConnection().getConnection(), one would get
a Connection from an internally managed pool? I could be wrong but my tests
indicate they are new connections, which seems to be consistent with the spec as
well.
Thanks.
On Thu, 30 May 2002 10:36:13 -0400,
in sybase.public.jconnect50
Marc Zampetti <zamp...@aol.com> wrote:
>I think your problem is that you are using the SybDataSource instead of
>using SybConnectionPoolDataSource. If you want to get connection
>pooling, when use the SybConnectionPoolDataSource. Your previous post
>about "chaining" the two DataSource implementations doesn't make sense
>to me. The SybDataSource is Sybase's implementation of the DataSource
>interface, and SybConnectionPoolDataSource is the implementation of the
>ConnectionPoolDataSource. You use one or the other, not both.
>
>Marc Zampetti
>
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp
My understanding is that the SybConnectionPoolDataSource implements a
pooling DataSource. So, all you need to do is call getConnection() from
SybConnectionPoolDataSource, and it will automatically come from the pool.
However, I haven't played with this much, and I definitely haven't gone
over the spec very well, so I could be wrong here. When I get a chance,
I will play with it some more.
I know that for Jaguar, when you setup a web app to use connection
pooling, you set the connection cache to use the
SybConnectionPoolDataSource, which is partly why I think what I do.
Marc
I think your problem is that you are using the SybDataSource instead of
"Marc Zampetti" <zamp...@aol.com> wrote in message
news:3CF69596...@aol.com...