使用springcloud 和 连接池 连接orcale数据库报错,折磨一天了,请大佬解救,启动都正常的

数据库使用PLsql可以连接上,ping数据库主机也是通的。找了一天问题了,求大佬解救一下。基本可以排除数据库问题,现在迷了一天了,想早点下班。。。

报错信息:

2018-12-28 17:00:06.350 ERROR 21560 --- [http-nio-9661-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.lang.NullPointerException
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:289) ~[spring-jdbc-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) ~[spring-tx-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447) ~[spring-tx-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) ~[spring-tx-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) ~[spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at grp.pt.common.bs.CacheService$$EnhancerBySpringCGLIB$$14ccc726.putMap() ~[grp-util-com-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at grp.pt.util.PublicSessionUtil.createSession(PublicSessionUtil.java:118) ~[grp-util-com-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at grp.pt.util.PublicSessionUtil.initSessionInfo(PublicSessionUtil.java:39) ~[grp-util-com-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at grp.util.session.UserSessionFilter.doFilter(UserSessionFilter.java:41) ~[grp-util-com-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.23.jar:8.5.23]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.23.jar:8.5.23]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.23.jar:8.5.23]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
Caused by: java.lang.NullPointerException: null
at grp.pt.util.PublicSessionUtil.getDataSourceBeanKey(PublicSessionUtil.java:138) ~[grp-util-com-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at grp.pt.database.DynamicDataSource.determineCurrentLookupKey(DynamicDataSource.java:21) ~[grp-database-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.determineTargetDataSource(AbstractRoutingDataSource.java:196) ~[spring-jdbc-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:164) ~[spring-jdbc-4.3.12.RELEASE.jar:4.3.12.RELEASE]
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:246) ~[spring-jdbc-4.3.12.RELEASE.jar:4.3.12.RELEASE]
... 46 common frames omitted

yml数据库配置内容

dynamicdata:
   #系统运行模式[Develop, Product]
    mode: Develop
    #默认数据源
    defaultKey: admdiv
    jndiName:
    data-sources:
    #数据源名: admdiv_年度_区划code
      admdiv:
        driverClassName: oracle.jdbc.driver.OracleDriver
        #url: jdbc:oracle:thin:@localhost:1521:orcl
        #driverClassName: com.mysql.jdbc.Driver
        #连接URL,协议+地址+Scheme
        #url: jdbc:mysql://localhost:3306/gap_ah?useUnicode=true&characterEncoding=utf8&useSSL=false
        username: yszx2018
        #密码
        password: a
        #数据库连接池配置样例
        url: jdbc:oracle:thin:@localhost:1521:orcl
        #连接池的最大连接数,-1为无限制
        maxActive: 8
        #最大空闲连接数,-1为无限制。注:如果是高负载系统,此值过低时可能会出现连接关闭的同时会打开新连接,连接池失效
        maxIdle: 8
        #在连接池满的情况下最长等待时间(毫秒),如果超时则抛异常,-1为一直等待
        maxWait: -1
        #初始连接数
        initialSize: 8
        #自动回收超时连接
        removeAbandoned: true
        #自动回收超时时间(以秒数为单位)
        removeAbandonedTimeout: 3600000
        #是否要进行检测
        testWhileIdle: true
        #进行检测一个连接是有效的SQL语句,比如oracle是select 1 from dual 而 mysql是 select 1
        validationQuery: select 1 from dual
        #每隔多少时间检测一次,比如每半小时检测一次,总不能总是检测,这会对性能产生影响
        timeBetweenEvictionRunsMillis: 180000
        #每次检测时,需要检测多少个数据连接,一般设置为与最大连接数一样,这样就可以检测完所有的连接
        numTestsPerEvictionRun: 8
        #一个数据库连接连接多少时间之外,我们认为其应该不再适用了(可能下一次就会失效了),应该移除并重新建立连接了
        minEvictableIdleTimeMillis: 3600000

1个回答

spring提供了在spring上下文中配置数据源Bean的多种方式,包括:

a.通过JDBC驱动程序定义的数据源;

b.通过JNDI查找的数据源;

c.连接池的数据源;

接下我们就专门来讲讲从使用连接池获取连接的数据源!(即c点)

上下文配置Bean的代码:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>
    <property name="username" value="wwo"/>
    <property name="password" value="wwo"/>
    <!-- 连接池启动时的初始值 -->
    <property name="initialSize" value="3" />
    <!-- 连接池的最大值 -->
    <property name="maxActive" value="300" />
    <!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 -->
    <property name="maxIdle" value="2" />
    <!-- 最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 -->
    <property name="minIdle" value="1" />
    <!-- end -->
</bean>

注:JDBC驱动数据源并没有池的概念,因此没有存在池属性的配置!

qq_34846007
迷途菜鸡 但是把连接池配置都去掉,还是一样的结果,报的错也一样的
9 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
解决启动springCloud报错
解决启动springCloud报错 启动springCloud报错: java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call ‘refresh’ before multicasting events via the context: org.springframework.boo...
求教高手,orcale数据库报错,不能连接
有一个服务器,别人都能连上rnrn同样的密码,同样的用户名,为什么我连不上rn报的错误如下:rnrnIO异常:the network adapter could not establish the connectionrnrn这是为什么?
Orcale与其他数据库的连接
大虾们!rn冰天雪地跪求:rn如何实现从Orcale 10g 连接到Sql server 2005。rn提供资料一样有分。rn
JAVA连接Orcale数据库
用于测试的表: 以下是演示的项目,分别演示了:1.普通方式连接数oracle数据库。2.使用jdbc.properties文件连接数据库。
C#连接ORCALE数据库..
现在用ORCALE数据库rn连接字符串如下:rnProvider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=MYID;Data Source=MYSOURCErn和rnProvider=MSDAORA.1;User ID=MYID;Data Source=MYSOURCE;Persist Security Info=Truern请问这两个连接方式有什么不同?rn另:Persist Security Info=True 和=False有什么不同?rn
Proxool连接池,连接SQLserver2008数据库报错
Caused by: java.lang.SecurityException: class “com.microsoft.sqlserver.jdbc.ISQLServerStatementFastClassByProxoolFastClassByProxool3407f37e“‘s signer information does not match signer information of ot
sybase启动不了,请解救
一个闲置了几个月的数据库,用isql连不上,reboot后尝试启动数据库,提示rn00:00000:00001:2002/03/27 16:50:57.46 server Opening Master Database ...rn00:00000:00001:2002/03/27 16:50:57.63 server Loading SQL Server's default sortrnorder and character setrn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit:0: listener type: masterrn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit:0: listener endpoint: /dev/trncprn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit:0: listener raw address: \x0rn00213888461133c0000000000000000rn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit:0: transport provider: T_COTrnS_ORDrn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit: t_bind, Cannot assign requernsted addressrn00:00000:00002:2002/03/27 16:50:57.65 kernel ninit: All master network listenerrns have failed. Shutting down.rn00:00000:00002:2002/03/27 16:50:57.65 kernel ueshutdown: exitingrn我搜索到有关的答复是rn rnThis indicates that the server has attempted to start on a machine that is not correctly configured to run a Sybase SQL server.rnrn我做过的操作只有改IP地址,闲置之前都是正常的,大侠能不能指点或者推测原因一下?rnrn重启动机器之前因为不清楚数据库是否启动,尝试启动时提示rn00:00000:00000:2002/03/27 16:43:30.59 kernel basis_dlock: file '/dev/dsk/c2t1d0rns1' already in use by a SQL Serverrn00:00000:00000:2002/03/27 16:43:30.63 kernel kdconfig: unable to read primary mrnaster devicern00:00000:00000:2002/03/27 16:43:30.63 kernel kiconfig: read of config block fairnledrn00:00000:00000:2002/03/27 16:46:17.51 kernel basis_dlock: file '/dev/dsk/c2t1d0rns1' already in use by a SQL Serverrn00:00000:00000:2002/03/27 16:46:17.51 kernel kdconfig: unable to read primary mrnaster devicern00:00000:00000:2002/03/27 16:46:17.51 kernel kiconfig: read of config block fairnledrn00:00000:00000:2002/03/27 16:47:14.14 kernel ueshutdown: exitingrn
orcale10g 数据库启动后报错不能正常连接
报错如下rnDump file d:\oracle\product\10.1.0\admin\orcl\udump\orcl_ora_4140.trcrnSat May 19 06:51:02 2007rnORACLE V10.1.0.2.0 - Production vsnsta=0rnvsnsql=13 vsnxtr=3rnOracle Database 10g Enterprise Edition Release 10.1.0.2.0 - ProductionrnWith the Partitioning, OLAP and Data Mining optionsrnWindows Server 2003 Version V5.2 Service Pack 2rnCPU : 4 - type 586, 2 Physical CoresrnProcess Affinity: 0x00000000rnMemory (A/P) : PH:1975M/3070M, PG:4048M/4966M, VA:1730M/2047MrnInstance name: orclrnrnRedo thread mounted by this instance: 1rnrnOracle process number: 22rnrnWindows thread id: 4140, image: ORACLE.EXE (SHAD)rnrnrn*** SERVICE NAME:(SYS$USERS) 2007-05-19 06:51:02.937rn*** SESSION ID:(146.60490) 2007-05-19 06:51:02.937rn*** 2007-05-19 06:51:02.937rnDBMS_DM_MODEL_EXP:schema_info_exp(schema=JYB, prepost=0, isdba=1, version=10.01.rn00.02.00)rn*** 2007-05-19 06:51:02.984rnDBMS_DM_MODEL_IMP:count_user_models: >> schema=JYBrn*** 2007-05-19 06:51:03.093rnDBMS_DM_MODEL_IMP:count_user_models: #ofmodel=0 in schema=>JYBrn*** 2007-05-19 06:51:03.109rnDBMS_DM_MODEL_EXP:schema_info_exp: # of models=0rn*** 2007-05-19 06:51:03.109rnDBMS_DM_MODEL_EXP:schema_info_exp: DM models not found in schema JYBrn*** 2007-05-19 06:51:13.468rnDBMS_DM_MODEL_EXP:schema_info_exp(schema=JYB, prepost=1, isdba=1, version=10.01.rn00.02.00)rn*** 2007-05-19 06:51:13.468rnDBMS_DM_MODEL_IMP:count_user_models: >> schema=JYBrn*** 2007-05-19 06:51:13.484rnDBMS_DM_MODEL_IMP:count_user_models: #ofmodel=0 in schema=>JYBrn*** 2007-05-19 06:51:13.484rnDBMS_DM_MODEL_EXP:schema_info_exp: # of models=0rn*** 2007-05-19 06:51:13.500rnDBMS_DM_MODEL_EXP:schema_info_exp: DM models not found in schema JYBrnDump file d:\oracle\product\10.1.0\admin\orcl\udump\orcl_ora_4140.trcrnFri Mar 07 04:00:46 2008rnORACLE V10.1.0.2.0 - Production vsnsta=0rnvsnsql=13 vsnxtr=3rnOracle Database 10g Enterprise Edition Release 10.1.0.2.0 - ProductionrnWith the Partitioning, OLAP and Data Mining optionsrnWindows Server 2003 Version V5.2 Service Pack 2rnCPU : 4 - type 586, 2 Physical CoresrnProcess Affinity: 0x00000000rnMemory (A/P) : PH:2205M/3070M, PG:4016M/4966M, VA:1761M/2047MrnInstance name: orclrnrnRedo thread mounted by this instance: 1rnrnOracle process number: 12rnrnWindows thread id: 4140, image: ORACLE.EXE (SHAD)rnrnrn*** SERVICE NAME:() 2008-03-07 04:00:46.921rn*** SESSION ID:(162.1) 2008-03-07 04:00:46.921rn attempting to start a parallel recovery with 3 processesrn parallel recovery started with 3 processesrnKCRP: using 357 overflow buffers per slavernThread 1 chkpt rba 0x002374.00000002.0010 scn 0x0000.022b7ea6rn Cache-low rba 0x002374.00004135.0000rn On-disk rba 0x002374.00004151.0000 scn 0x0000.022b932brn Use cache-low rba for recoveryrnThread 1 start rba 0x002374.00004135.0000 scn 0x0000.00000000rn----- Redo read statistics for thread 1 -----rnRead rate (ASYNC): 14Kb in 0.12s => 0.00 Mb/secrnLongest record: 0Kb, moves: 0/46 (0%)rnLongest LWN: 9Kb, moves: 0/4 (0%), moved: 0Mbrn----------------------------------------------rn----- Recovery Hash Table Statistics ---------rnHash table buckets = 32768rnLongest hash chain = 1rnAverage hash chain = 13/13 = 1.0rnMax compares per lookup = 1rnAvg compares per lookup = 79/92 = 0.9rn----------------------------------------------rn*** 2008-03-07 04:00:47.859rnKCRA: start recovery claims for 13 data blocksrn*** 2008-03-07 04:00:47.890rnKCRA: blocks processed = 13/13, claimed = 13, eliminated = 0rn----- Recovery Hash Table Statistics ---------rnHash table buckets = 32768rnLongest hash chain = 1rnAverage hash chain = 13/13 = 1.0rnMax compares per lookup = 1rnAvg compares per lookup = 92/92 = 1.0rn----------------------------------------------rnUndo Segment 1 OnlinedrnUndo Segment 2 OnlinedrnUndo Segment 3 OnlinedrnAssigned RBS 4 to pool 0rnUndo Segment 4 OnlinedrnAssigned RBS 5 to pool 1rnUndo Segment 5 OnlinedrnAssigned RBS 6 to pool 2rnUndo Segment 6 OnlinedrnAssigned RBS 7 to pool 3rnUndo Segment 7 OnlinedrnAssigned RBS 8 to pool 4rnUndo Segment 8 OnlinedrnAssigned RBS 9 to pool 5rnUndo Segment 9 OnlinedrnAssigned RBS 10 to pool 6rnUndo Segment 10 Onlinedrnadbdrv: lang flag = 0 rn重起以后变成这样rn
php连接orcale数据库使用ajax无法登陆
if(username!=""&& password!="") rn $.ajax(rn url: '../php/login.php',rn type: 'POST',rn data: rn username: username,rn password: password,rn comobox: comoboxrn ,rnrn// contentType: "application/json",rn success: function (res) rn console.log(res); //每次都走到这里不走了rn// console.log(typeof res);rn if (res >= 1) rn// window.location.href='yearMaga.html';rn header(yearMaga.html);rn else if (res < 1) rn alert("账号或者密码错误请核对后再登录");rn rn rn );rn return false;rn rn rn return rn init:function()rn body=e('body');rn btnLogin=body.find('.submit');rn eventHandler();rn rn rn ();rn login.init();
ORCALE数据库语句报错提示
select a.ObjectID,a.WorkflowCode,b.ParentPid,a.CreatedTime,c.DisplayName+'['+a.WorkflowCode+']' as WorkflowName,rn(CASE WHEN a.PlanFinishTime>=a.FinishTime THEN 0 ELSE 1 END) AS IsOverTimern,round(a.UsedTime / 600000000 ,2)as UseMinute1rn,round(a.UsedTime / 600000000,2) as UseMinute2rn,round(a.UsedTime / 600000000 ,2)as UseMinute3rn,datename(YEAR,a.StartTime)+datename(MONTH,a.StartTime) as CreatedMonth,1 as WorkflowCountrnfrom OT_InstanceContext as arninner join OT_OrganizationDim as b on a.Originator=b.ChildIdrninner join OT_WorkflowClause as c on a.WorkflowCode=c.WorkflowCodernwhere a.[State]=4rnrn看看这个orcale语句有没有不对的地方rn在线等,感谢!!!!
Orcale连接池异常解决办法
命令窗口下:    show parameter session;    SQL窗口下:    alter system set sessions=1000 scope=spfile;    命令窗口下:    show parameter open;    SQL窗口下:    alter system set open_cursors=3000 scope=spfile;  
连接池都已被使用
系统提示如下:rn超时时间已到。在从池中获取连接时间前超时时间已过。出现这种情况可能是因为rn所有池连接都已被使用并以达到最大池大小rnrn我已经把连接时间改为无限制,可还是出现这种情况!怎么办!!!
用数据库连接池连接orcale数据库
用数据库连接池连接orcale数据库java代码实现,通用性强
ADO.NET连接ORCALE数据库出问题
我项目本身发布在本机上访问本机的数据库是没问题的.rn后来项目发布在IIS上面访问服务器上的数据库就出现[color=#FF0000]有的时候[/color]连接不上去的问题了.过一段时间在访问又可以了!rn今天下午我又建了一个账号直接在本机访问服务器上的数据库,也是连接不上去.rn是什么原因啊? 我程序的问题还是服务器上的数据库问题啊?rn其他原因?rn用本机访问服务器上的数据库,报的是connetion未初始化?
asp.net如何连接Orcale数据库
asp.net如何连接Orcale数据库
asp如何连接orcale数据库!
请问用asp连接orcale数据库是怎么实现的?rn使用odbc还是oledb,若为odbc请给出具体的步骤,rn请说明数据源的provider.
ASPNET连接Orcale数据库出错?
我的环境:VS2003,Orcale9irnstring myConnStr="Data Source=ZZ;User Id=MYVSNET;Password=MYVSNET";rnOracleConnection myConn=new OracleConnection(myConnStr);rnmyConn.Open();rn//......(中间代码省略)rnmyConn.Close();rnrn异常详细信息: System.DllNotFoundException: 无法加载 DLL (oci.dll)。rn源错误: rn行 60: myConn.Open();rnrn说明:在WINDOWS窗体程序中,没有出错
Linux 连接orcale数据库不成功
我在Linux下面部署了几套程序布到其中一套的,数据库怎么也链接不上rn[img=https://img-bbs.csdn.net/upload/201607/14/1468428553_370866.png][/img]rn我测试一下,可以连接上去的,而且前面几套都是这么链接可是偏偏这一套不行。大家能告诉我有哪些可能导致链接不上。rn[img=https://img-bbs.csdn.net/upload/201607/14/1468428697_471564.png][/img]
C#字符串(折磨我一天了)
string A = "\\u4e59\\u70ef";rn如何利用A,使用一个方法,得到结果:rn"\u4e59\u70ef".rn(C#, VS2005)
dubbo---折磨我一天的东西
http://dubbo.io/User+Guide-zh.htm#UserGuide-zh-%E5%85%A5%E9%97%A8 采用单一长连接和NIO异步通讯, 适合于小数据量大并发的服务调用,以及服务消费者机器数远大于服务提供者机器数的情况 这是一个学习网站,当初接触dubbo是因为新项目需要用到分布式的架构,因为联通的项目,至少是和30多个省 一起交互,这就需要更大的吞吐量,
折磨死人的 ORA-01422报错
create or replace function &quot;F_BHM_HT_GETEMPID_BYLOG2&quot;(logname in VARCHAR2)return  NUMBERisl_empid number;--l_count number;beginselect  a.id into l_empid from ESUN_EMP a where upper(a.logname)=upper(lo...
maven 项目导入报错 如图!!! 求大佬解救
-
使用连接池连接IBM DB2数据库
最近在论坛上看到有人总结了连接池的使用,很可惜的是他仅仅总结了Oracle和SQL Server这两种。现在,我把IBM DB2的连接池技术补充上。以供大家参考!rnrnTomcat配置:rnrnrnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn factoryrnrn org.apache.commons.dbcp.BasicDataSourceFactoryrnrn rnrn rnrn maxActivernrn 100rnrn rnrn rnrn maxIdlernrn 30rnrn rnrn rnrn maxWaitrnrn 10000rnrn rnrn rnrn usernamernrn 数据库的用户名rnrn rnrn rnrn passwordrnrn 数据库的密码rnrn rnrn rnrn driverClassNamernrn COM.ibm.db2.jdbc.app.DB2Driverrnrn rnrn rnrn urlrnrn jdbc:db2:数据库名rnrn rnrn rnrnrnrn记得要有DB2的驱动!由于各版本的不同获得的方法可能不同。V7.2中是在安装目录下的java12下找!没有的话可以双击jdbc20.exe生成。记得要把它变成.jar文件才可以用的!rnrn水平有限,请不吝指教!rnrn
使用tomcat连接池访问数据库得不到连接
最近做了个jsp的网站,数据量不大,网站发布上线后,问题来了,求高人解决,感激不尽。开始可以正常访问,多点几次之后,就连不上数据库了,使用的tomcat连接池,重启tomcat后恢复正常,总不能整天重启tomcat呀。异常信息如下:rnjava.sql.SQLException: null, message from server: "Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug"rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1079)rn at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2032)rn at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:729)rn at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:46)rn at sun.reflect.GeneratedConstructorAccessor17.newInstance(Unknown Source)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)rn at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283)rn at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)rn at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)rn at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)rn at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)rn at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)rn at com.jx.sxd.jdbc.DBConnetion.getConnection(DBConnetion.java:21)rn at com.jx.base.counselor.dao.impl.CounselorDaoImpl.queryPage(CounselorDaoImpl.java:234)rn at com.jx.base.counselor.dao.impl.CounselorDaoImpl.pageQuery(CounselorDaoImpl.java:206)rn at com.jx.base.counselor.service.impl.CounselorServiceImpl.pageQuery(CounselorServiceImpl.java:40)rn at com.jx.base.reception.action.ReceptionAction.initIndex(ReceptionAction.java:56)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn 1.使用tomcat连接池。修改server.xml文件如下:rn找到server.xml中的rnrn这一行,并改为rnrn rn rn2.在应用程序的web.xml文件中,上边添加如下代码:rn rn sxd Datasource example rn jdbc/sxdDS rn javax.sql.DataSource rn Container rn rn3.程序中的java类,得到连接。DBConnection.javarnpublic class DBConnetion rn rn private Connection conn = null;rn private PreparedStatement psta = null;rn public Connection getConnection() rn try [color=#FF0000]rn Context cxt = new InitialContext();rn DataSource ds=(DataSource) cxt.lookup("java:comp/env/jdbc/sxdDS");rn conn=ds.getConnection();[/color] rn catch (NamingException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return conn;rn rnrn public PreparedStatement getPsta(String sql) rn conn = this.getConnection();// 得到连接rn try rn psta = conn.prepareStatement(sql);rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn return psta;rn rn /**rn * 关闭Connetion连接rn * @param connrn */rn [color=#FF0000]public void closeConnetion(Connection conn) rn if (conn != null) rn try rn conn.close();rn conn = null;rn catch (SQLException e) rn e.printStackTrace();rn finally rn if(conn != null)rn try rn conn.close() ;rn catch (SQLException e) rn e.printStackTrace();rn rn rn rn [/color] /**rn * 关闭所有连接rn * @param connrn * @param pstarn * @param rsrn */rn public void closeAll(Connection conn, PreparedStatement psta, ResultSet rs) rn try rn rn if (rs != null) rn rs.close();rn rs = null;rn rn if (psta != null) rn psta.close();rn psta = null;rn rn if (conn != null) rn this.closeConnetion(conn);rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rnrn求高手指点,是资源没有成功释放吗?那应该怎么释放?还是其他什么问题?
c#编程 wince系统连接Orcale数据库报错
我现在想做PDA+Oracle的项目,vs中写的连Oracle数据库的类(在vs2010中可以运行),在vs2008中运行就报错,错误 1 类型“System.Data.Common.DbConnection”在未被引用的程序集中定义。必须添加对程序集“System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”的引用。 D:\项目\欧亚\采集器端\采集器端\DB.cs 12 33 采集器端,求指教!!!rnrnwince支持Oracle数据库吗?
TOMCAT下配置连接池后不能正常启动
在TOMCAT下配置连接池后不能正常启动.rnrn连接池配置rnJNDI Name: jdbc/rlzy rnData Source URL: jdbc:microsoft:sqlserver://localhost:1433;databaseName=testrnJDBC Driver Class:com.microsoft.jdbc.sqlserver.SQLServerDriverrnUser Name:sarnPassword: rnMax. Active Connections: 4rnMax. Active Connections: 2rnMax. Wait for Connection: 5000rnValidation Query://不填rn重启TOMCAT后运行http://localhost:8080/rn出现错误提示:rntype Status reportrnmessage /rndescription The requested resource (/) is not available.rnrn在STDERR.LOG文件里的出错信息是:rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/classes/application.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Contextrnjavax.naming.NameNotFoundException: Name jdbc is not bound in this Contextrnrnapplication.xml中的代码是:rn rn java:comp/env/jdbc/rlzyrn rnrn rn rn rn rn com/hn/rlzy/bean/code/Zzmm.hbm.xmlrn rn rn rn rn net.sf.hibernate.dialect.OracleDialectrn truern 50rn 25rn rn rn rnrn请问这是什么原因?急急急rnrn
spring整合quartz定时任务报错,请大神们解救
web.xml中的配置rnrn spring_mvcrn org.springframework.web.servlet.DispatcherServletrn rn contextConfigLocationrn classpath:applicationContextrn rn rn rn spring_mvcrn /rn rnrnrnapplicationContext.xml的配置rn rn rn rn rn rn rn rn rn rn rn workrn rn rn rn rn rn rn rn rn rn 0 */1 * * * ?rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn工作类的代码rnpublic class QuartzJob rnrn public void work()rn rn System.out.println("Quartz的任务调度!!!");rn rnrnrnrnrn测试类的代码rn public class Main rn public static void main(String[] args) rn ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");rn //如果配置文件中将startQuertz bean的lazy-init设置为false 则不用实例化rn //context.getBean("startQuertz");rn rnrnrnrn控制台打印的错误信息rnException in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startQuertz' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/quartz/spi/JobFactoryrnrnCaused by: java.lang.NoClassDefFoundError: org/quartz/spi/JobFactory
启动ci程序报错,应用程序无法正常启动0xc000007b,困扰多天了,大神们求解救
[img=https://img-bbs.csdn.net/upload/201709/14/1505375947_414539.png][/img]
(急!!!)为什么在DELPHI6.0中的ADO不能正常使用ORCALE的数据库?
我新建了一个ORCALE的数据库名为JcrxDbrn建立了系统的用户、权限、数据表等,然后在DELPHI的ADO对这个数据库操作rn在ADOCONNECT建立连接串时如果使用ORCALE自已的数据库提供者,然后再使用ADOTABLE中选择这个数据库的表时会显示一个“数据提供者或其它服务返回E_FAIL状态"rn如果使用了ODBC for Orcale的驱动,再用ADOTABLE时则可以选择其中的表,然后放置一个数据源控件,再放一个TDBGrid数据控件设置数据源,此时会出现“一个末知的错误的提示“这是为什么?rn如何才能访问该数据库的数据?请诸位大侠帮助!rn
2003每次启动都报错
在系统启动时至少有一个服务或驱动程序产生错误。详细信息,请使用事件查看器查看事件日志。rnrnrnrnrn请问如何去掉这个报错对话框?谢谢
IReport报错求解救
[color=#FF0000]Error filling print... Error retrieving field value from bean : name rnnet.sf.jasperreports.engine.JRException: Error retrieving field value from bean : name      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:123)      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)      at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:100)      at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:1356)      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1257)      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:1233)      at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1577)      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:149)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:932)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:864)      at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:114)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653)      at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:569)      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:915)      at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:928)      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)  Caused by: java.lang.NoSuchMethodException: Unknown property 'name' on class 'class com.jaspersoft.ireport.examples.beans.PersonBean'      at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1322)      at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:770)      at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:846)      at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)      at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:111)      ... 16 more  rnPrint not filled. Try to use an EmptyDataSource...rn[/color]
请各位大师帮忙,启动数据库报错!!
我在启动数据库时都没有问题,执行svrmgrl,shutdown,startup,lsnrctl都没有问题呢,是不是oracle已经装好了吗?rn但是我进入数据库时sqlplus system/manager as system就报错运行不了,错误是:segmentation fault(core dumped)
启动数据库报错:
SD2-100-RAC1:/home/oracle>srvctl start database -d anyang PRCR-1079 : Failed to start resource ora.anyang.db CRS-5017: The resource action "ora.anyang.db start" encountered the following error:  OR
连接池问题--第二次使用连接池的连接问题
我写了一个连接池,当新建连接的时候是可以取道数据库中的数据的(mysql),当把连接放到池中,第二次取出后,就不能取到数据库中的最新数据,不知道为什么?
JSF启动数据库报错
高手帮我分析下 我的一个受管bean类实现了对数据库查询操作,但是登陆系统的时候tomcat报错rnexception rnrnjavax.servlet.ServletExceptionrn javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)rnrnroot cause rnrnjava.lang.NullPointerExceptionrn org.jia.EManage.web.SelectExperimentBean.getAdminExperiment(SelectExperimentBean.java:85)rnrn其中报错的85行代码为rn[code=Java]public ArrayList getAdminExperiment()throws Exceptionrn rn return experimentDaoImpl.getAdminExperiment();rn [/code]rnrn其中具体的数据库操作方法代码为rn[code=Java] public ArrayList getAdminExperiment() throws Exceptionrn ArrayList result=new ArrayList(); rn Connection conn=null;rn PreparedStatement stmt=null;rn ResultSet rs=null;rn tryrn conn=DBConn.getCon();rn String sql="select * from experiment where status = ?";rn stmt=conn.prepareStatement(sql);rn stmt.setInt(1, 0);rnrn while(rs.next())rn //查询结果转化为Experiment对象rn Experiment experiment=new Experiment();rnrn experiment.setId(rs.getInt("id"));rn experiment.setAim(rs.getString("aim"));rn experiment.setDescribe(rs.getString("describes"));rn experiment.setComments(rs.getString("comments"));rn experiment.setName(rs.getString("name"));rn experiment.setStatus(rs.getInt("status"));rn experiment.setInitiatedId(rs.getInt("initiatedId"));rn rn result.add(experiment);rn rn //取得初始状态的实验列表rn rn catch(SQLException sqle)rn throw new SQLException("select data exception:"+rn sqle.getMessage());rn catch(Exception e)rnrn rn return result;rn rn [/code]
求助启动TOMCAT一直在报错,困扰一天了
这里是日志rnrn六月 23, 2014 4:57:33 下午 org.apache.catalina.core.AprLifecycleListener initrnINFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.rn六月 23, 2014 4:57:33 下午 org.apache.catalina.core.AprLifecycleListener initrnINFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].rn六月 23, 2014 4:57:34 下午 org.apache.catalina.core.AprLifecycleListener initializeSSLrnINFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)rn六月 23, 2014 4:57:34 下午 org.apache.coyote.AbstractProtocol initrnINFO: Initializing ProtocolHandler ["http-apr-8088"]rn六月 23, 2014 4:57:34 下午 org.apache.coyote.AbstractProtocol initrnINFO: Initializing ProtocolHandler ["ajp-apr-8009"]rn六月 23, 2014 4:57:34 下午 org.apache.catalina.startup.Catalina loadrnINFO: Initialization processed in 1584 msrn六月 23, 2014 4:57:34 下午 org.apache.catalina.core.StandardService startInternalrnINFO: Starting service Catalinarn六月 23, 2014 4:57:34 下午 org.apache.catalina.core.StandardEngine startInternalrnINFO: Starting Servlet Engine: Apache Tomcat/7.0.40rn六月 23, 2014 4:57:34 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\docsrn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\examplesrn六月 23, 2014 4:57:35 下午 org.apache.catalina.core.ApplicationContext logrnINFO: ContextListener: contextInitialized()rn六月 23, 2014 4:57:35 下午 org.apache.catalina.core.ApplicationContext logrnINFO: SessionListener: contextInitialized()rn六月 23, 2014 4:57:35 下午 org.apache.catalina.core.ApplicationContext logrnINFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@5cdeb323')rn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\host-managerrn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\managerrn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\ROOTrn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnINFO: Deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\sttrn六月 23, 2014 4:57:35 下午 org.apache.catalina.core.ContainerBase addChildInternalrnSEVERE: ContainerBase.addChild: start: rnorg.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/stt]]rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rnCaused by: java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;rn at java.lang.Class.getDeclaredFields0(Native Method)rn at java.lang.Class.privateGetDeclaredFields(Class.java:2308)rn at java.lang.Class.getDeclaredFields(Class.java:1760)rn at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)rn at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationFilterAnnotations(WebAnnotationSet.java:110)rn at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:66)rn at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)rn at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn ... 11 morernCaused by: java.lang.ClassNotFoundException: org.slf4j.Loggerrn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)rn at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)rn ... 25 morern六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.HostConfig deployDirectoryrnSEVERE: Error deploying web application directory D:\Program Files\apache-tomcat-7.0.40\webapps\sttrnjava.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/stt]]rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)rn六月 23, 2014 4:57:35 下午 org.apache.coyote.AbstractProtocol startrnINFO: Starting ProtocolHandler ["http-apr-8088"]rn六月 23, 2014 4:57:35 下午 org.apache.coyote.AbstractProtocol startrnINFO: Starting ProtocolHandler ["ajp-apr-8009"]rn六月 23, 2014 4:57:35 下午 org.apache.catalina.startup.Catalina startrnINFO: Server startup in 844 msrnrnrn
使用Jedis连接池时报错
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/pool2/PooledObjectFact添加commons-pool2 jar包即可
springcloud整合druid连接池或者HikariCP连接池
Druid连接池 1.添加配置 spring: # 数据库配置 datasource: # 数据源 type: ${db-type} driverClassName: ${db-driverClass} url: ${db-url} username: ${db-username} password: ${db...
eclipse中Springboot启动,jdbc连接池报错
在eclipse中启动Springboot,报错如下 APPLICATION FAILED TO START Description: Cannot determine embedded database driver class for database type NONE Action: If you want an embedded database please put a suppo...
java连接池连接sql数据库
请问大家,java用JDBC连接池连接sql数据库时,是不是要锁住此时的数据库,不让别的程序使用,等此程序用完此数据库时,才释放数据库,供别的程序使用,是不是这样啊,谢谢大家指点一下
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数