<Context path="/DBTest" docBase="DBTest" debug="5"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/TestDB" auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>username</name>
<value>vf4jacky</value>
</parameter>
<parameter>
<name>password</name>
<value>letsgo</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.sybase.jdbc3.jdbc.SybDriver</value>
<-고친곳
</parameter>
<parameter>
<name>url</name>
<value>jdbc:sybase:Tds:localhost:5000/unipubs2?autoReconnect=true</value>
<-고친곳
</parameter>
</ResourceParams>
</Context>
DBCP를 사용하려고 합니다.
Tomcat을 사용하고 있구요.
저기 위에 소스는 Tomcat Document에 있는 server.xml에 설정
방법입니다.
원래는 mysql을 이용한 방식으로 설명이 나와 있었는데 mysql로 사용해
보니까 잘 되었습니다.
그래서 sybase에서 접속해 보려고 파라미터 Driver와 uri 부분만을
수정하고 돌려보니 접속이 되질 않는군요.
그리고 Sybase에 자체적으로 Connection Pool 기능을 갖춘 클래스
같은것들이 있는지요? 보니까
com.sybase.jdbc3.jdbc.SybConnectionPoolDataSource 라는 클래스가
있던데..
아.. 그리고 톰켓 스타트 창에는 이런 에러가 나옵니다.
java.sql.SQLException: JZ006: IOException 발견:
java.net.ConnectException: Connection refused: connect
at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown
Source)
at
com.sybase.jdbc3.jdbc.ErrorMessage.raiseErrorCheckDead(Unknown
Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.login(Unknown Source)
at com.sybase.jdbc3.jdbc.SybConnection.a(Unknown
Source)
at com.sybase.jdbc3.jdbc.SybConnection.a(Unknown
Source)
at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown
Source)
at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown
Source)
at com.sybase.jdbc3.jdbc.SybDriver.connect(Unknown
Source)
at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:82)
at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:300)
at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:838)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:821)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
at foo.DBTest.init(DBTest.java:23)
at
org.apache.jsp.test_jsp._jspService(test_jsp.java:49)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
|