javaweb,使用jdbc连接别人的ORACLE数据库,报错Undefined Error

同样的代码,其他人都可以连上,,,但是我会报错。。
错误日志:
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: IO 错误: Undefined Error
at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:545)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:537)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:116)
at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:72)
at com.zf.dbpool.ConnectionManager.connection(ConnectionManager.java:99)
at com.zf.dbpool.ConnectionManager.init(ConnectionManager.java:59)
at com.zf.statistics.service.impl.StatisticsServiceImpl.saveSzdwXyData(StatisticsServiceImpl.java:67)
at com.zf.statistics.service.impl.StatisticsServiceImpl.main(StatisticsServiceImpl.java:209)
Caused by: java.sql.SQLRecoverableException: IO 错误: Undefined Error
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:117)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:123)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:375)
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:204)
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:445)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:516)
... 6 more
Caused by: oracle.net.ns.NetException: Undefined Error
at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:271)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:317)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)

5个回答

Oracle数据库的版本和jdbc得版本是一致的吗?

qq_36611128
aslkdglasdg 回复片刻清夏: 很感谢。。但是我同事都连的上。。就我的不行。。这个是关键。。因为是从svn导下来的项目。。
2 年多之前 回复
zjq_1314520
片刻清夏 回复qq_36611128: 参考一下文章找到相同版本的jdbc:http://www.cnblogs.com/tv151579/archive/2013/02/26/2933405.html 装数据库的时候就有相应的jdbc,不用自己去下载的!
2 年多之前 回复
qq_36611128
aslkdglasdg oraccle是连接别人的,这个不太懂。。用相同的代码跑,大家都连的上,就我会报这个错。。
2 年多之前 回复

oraccle是连接别人的,这个不太懂。。用相同的代码跑,大家都连的上,就我会报这个错。。

mysql的数据库可以连,就是ORACLE的连不了。。应该不是代码问题。。我 用的开发工具是eclipse。。求大神帮忙下。。

换个oracle的驱动试试。

qq_36611128
aslkdglasdg 大家都是用一样的驱动包,而且开发工具也一样。。都是eclipse。。然后就我这边不行
2 年多之前 回复

ping那台电脑能通不?

cxy20170309
Ice_Blue_Brother 回复Ice_Blue_Brother: 如果有svn连着,还原一下在你这边尝试也行
2 年多之前 回复
cxy20170309
Ice_Blue_Brother 回复aslkdglasdg: 你直接把你的所有相关代码复制粘贴给你朋友试试?直接把文件或者工程发给对方更好,如果不行,那就是代码问题,而且是极难找到那种粗心问题之类的……如果行……我表示虾米的我就不知道了……找大佬给你看一下吧,说不定是不相关的地方出问题 了
2 年多之前 回复
qq_36611128
aslkdglasdg ping是可以的,可能是电脑问题,但是我用其他数据库连接工具链接ORACLE是可以连上的,就是eclipse不行,,然后我重新解压一份eclipse也不行。。
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java web 应用连接oracle数据库问题

java写的web应用连接数据库时显示无匹配driver ,直接应用程序启动正常,在服务器上启动就报上述错误

javaWeb开发中,mysql数据库报错连不上,求高手

做javaWeb开发,mysql数据库连不上![图片](https://img-ask.csdn.net/upload/201710/21/1508577596_944078.jpg)

Java web jdbc怎么连接数据库,要配置什么啊

代码都已经打完了,但是一直连接不成功,sqlserver数据库驱动也下下来了并放到buding path里了,sqlserver协议tcp/ip也更改了,数据库也用用户名密码登陆了,还差什么啊,求大神指教,下面是代码,都是网上的,应该没错。 package com.demo; import java.io.*; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import javax.servlet.*; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class register */ @WebServlet("/register.do") public class register extends HttpServlet { public Connection cn; public PreparedStatement ps; public ResultSet rs; //连接数据库 public void getCn() { String url="jdbc:microsoft:sqlserver://192.168.1.119:1433;DatabaseName=Web"; String driverpath="com.microsoft.jdbc.sqlserver.SQLServerDriver"; String name="sa"; String pwd="123456"; try{ Class.forName(driverpath); cn=DriverManager.getConnection(url,name,pwd); if(cn!=null) { System.out.println("ok"); cn.close(); } else System.out.println("数据库连接失败!"); }catch(Exception e) { e.printStackTrace(); } } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.getWriter().append("Served at: ").append(request.getContextPath()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ //得到post资源 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=gbk"); PrintWriter out=response.getWriter(); String name=request.getParameter("username"); String pwd=request.getParameter("password"); System.out.println(name); System.out.println(pwd); if(this.insert(name,pwd)==true) { out.println("注册成功"); } else out.println("注册失败"); out.flush(); out.close(); } //注册添加数据 public boolean insert(String name,String pwd) { getCn(); boolean b=false; String sql="insert into login values(?,?)"; try{ ps=cn.prepareStatement(sql); ps.setString(1, name); ps.setString(2, pwd); ps.execute(); b=true; }catch(Exception e) { e.printStackTrace(); }finally { try{ if(rs!=null) rs.close(); else if(ps!=null) ps.close(); else if(cn!=null) cn.close(); }catch(Exception e){} } return b; } }

导入一个javaweb的源代码,连接数据库总是报错?

导入一个项目的源代码,连接数据库总是出错,有没有大神遇到过,指点下谢谢! 错误如下: 警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@be49d94 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775) at com.mysql.jdbc.Connection.<init>(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

菜鸟在Javaweb连接数据库时得异常

java.sql.SQLException: no such table: Boke Query: select id,title,brief,content,author,date,bokeid from Boke Parameters: [] 封装的查询方法在用main测试时可以查询到数据,但在web服务开启之后它就始终报这个异常,不知道哪的问题,大神help

javaweb连接不到数据库了,出现这样的错误,有大神可以解决吗

Mon Jun 10 15:31:18 CST 2019 : 已使用基本服务器安全策略安装了安全管理程序。 Mon Jun 10 15:31:20 CST 2019 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve") java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkListen(SecurityManager.java:1131) at java.net.ServerSocket.bind(ServerSocket.java:374) at java.net.ServerSocket.<init>(ServerSocket.java:237) at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231) at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source) at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source) at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source) at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source) at org.apache.derby.drda.NetworkServerControl.main(Unknown Source) ``` ```

导入JavaWeb项目时,MySQL数据库报错

五月 23, 2014 10:19:38 上午 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8. 五月 23, 2014 10:19:39 上午 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 五月 23, 2014 10:19:40 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013) 五月 23, 2014 10:19:41 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 五月 23, 2014 10:19:41 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 五月 23, 2014 10:19:41 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 9630 ms 五月 23, 2014 10:19:41 上午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 五月 23, 2014 10:19:41 上午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.0.5 五月 23, 2014 10:19:41 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\docs 五月 23, 2014 10:19:42 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [266] milliseconds. 五月 23, 2014 10:19:42 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\examples 五月 23, 2014 10:19:44 上午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 五月 23, 2014 10:19:44 上午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 五月 23, 2014 10:19:44 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\guaranty 五月 23, 2014 10:19:49 上午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 五月 23, 2014 10:19:50 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 10:19:52,734 ERROR ContextLoader:319 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [H:\apache-tomcat-8.0.5\webapps\guaranty\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.service.classloading.spi.ClassLoadingException: HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4739) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5159) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:142) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:78) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2283) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2279) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1748) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1788) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:247) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:373) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485) ... 25 more Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [com.mysql.jdbc.Driver] at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:149) at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:139) ... 43 more Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.mysql.jdbc.Driver at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:296) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:146) ... 44 more 五月 23, 2014 10:19:52 上午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [H:\apache-tomcat-8.0.5\webapps\guaranty\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.service.classloading.spi.ClassLoadingException: HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1488) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4739) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5159) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:697) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1134) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1780) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: HHH010003: JDBC Driver class not found: com.mysql.jdbc.Driver at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:142) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:78) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2283) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2279) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1748) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1788) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:247) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:373) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:358) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1547) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485) ... 25 more Caused by: org.hibernate.service.classloading.spi.ClassLoadingException: Unable to load class [com.mysql.jdbc.Driver] at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:149) at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:139) ... 43 more Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.mysql.jdbc.Driver at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:296) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:146) ... 44 more 五月 23, 2014 10:19:52 上午 org.apache.catalina.core.StandardContext startInternal 严重: Error listenerStart 五月 23, 2014 10:19:52 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/guaranty] startup failed due to previous errors 五月 23, 2014 10:19:52 上午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 五月 23, 2014 10:19:52 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\host-manager 五月 23, 2014 10:19:52 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\manager 五月 23, 2014 10:19:52 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory H:\apache-tomcat-8.0.5\webapps\ROOT 五月 23, 2014 10:19:53 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 五月 23, 2014 10:19:53 上午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 五月 23, 2014 10:19:53 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 11568 ms

菜鸟求问javaweb的用jdbc操作mysql数据库出错

![图片说明](https://img-ask.csdn.net/upload/201601/18/1453091203_851502.png)

JavaWeb项目,连接mysql数据库之后报出这个错误

JavaWeb项目,连接mysql数据库之后报出这个错误,在CentOS6.5系统下创建的项目,root用户下创建的数据库,没有设置密码 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

LAMP18.04下javaweb项目用JDBC连接mysql5.7.28失败,报错java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver

![图片说明](https://img-ask.csdn.net/upload/202004/28/1588078729_897594.png) 这个是云服务器运行连接数据库的字节码文件,连接成功会输出一句话“连接数据库成功”。 但奇怪的是,**这个项目在本机上运行没有报错**。更奇怪的是,这个部署在云服务器上的项目**jsp页面有时可以将数据库的内容输出出来,**也可以进行增删改查等操作。但大概一晚上就连接不到了。 第一:我进行了如下努力。本机的数据库版本较高,所以又加入了 mysql-connector-java-5.1.47的包。 ![图片说明](https://img-ask.csdn.net/upload/202004/28/1588079666_343267.png) 第二,我在本机上连接云服务器的数据库,连接成功。但在云服务器上总是不稳定,(**_因此我认为我的数据库连接的jar包应该成功加入了项目,不然本地怎么能连接云服务器的数据库呢,而且数据库信息肯定是正确的_**) 第三:我目前的驱动是driver = "com.mysql.cj.jdbc.Driver"。 这个网上显示mysql5.7应该使用"com.mysql.jdbc.Driver",但我使用这个就会报错java.lang.ClassNotFoundException: com.mysql.jdbc.Driver **有一个明显的规律**。如果jsp页面没有显示数据库内容,只要我将war包解压后的文件夹删除,重新访问生成新的文件夹,jsp页面就可以显示数据库的内容,可以增删改查 希望哥哥姐姐们如果知道或者有其他想法可以解答一下!拜托了

使用SSH开发JavaWeb应用,怎样连接到网络数据库?

如题,我在阿里云上开了一个数据库RDS,在本地开发时配置Hibernate如下: ``` <!-- 数据库连接设置 --> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <!-- 技术:数据库类型:服务器ip/数据库名 --> <property name="connection.url">jdbc:mysql://我的服务器ip地址:3001/mywebset</property> <property name="connection.username">root</property> <property name="connection.password">Li774717903</property> <!-- 配置dialect方言,明确告诉hibernate连接的是哪种数据库 --> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> ``` 端口、数据库名、用户名、密码都是正确的,但是在访问数据库时报错,错误发生在我的HibernateUtil类中: ``` HibernateUtil() { sessionFactory = new Configuration().configure().buildSessionFactory();//此处报错 System.out.println("HibernateUtil : 连接成功"); } ``` 我想知道连接网络上的数据库需要怎样配置? 部分错误信息如下: ``` Type Exception Report Message Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:267) org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:231) org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:240) org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111) org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83) org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418) org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691) org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726) com.hibernate.dao.HibernateUtil.<init>(HibernateUtil.java:13) com.hibernate.dao.MusicDao.getAll(MusicDao.java:61) com.struts.action.IndexAction.toMusic(IndexAction.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) ```

在liunx上的javaweb后台连接不到数据库 ,但是app可以连接到数据库

``` java.lang.Exception: 数据库连接失败:Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user 'root'@'localhost' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3421) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1247) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2924) at com.mysql.jdbc.Connection.<init>(Connection.java:1555) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at com.xabeiying.lefu.server.utils.ConnectionToMysql.getConnectionDB(ConnectionToMysql.java:103) at com.xabeiying.lefu.server.dao.ZFDao.getzfbddh11sc(ZFDao.java:58) at com.xabeiying.lefu.server.action.GetJSWYWXAction.doPost(GetJSWYWXAction.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ** END NESTED EXCEPTION ** ``` 数据库是安装在liunx上的mysql, 和程序在一台服务器上面,这个数据库在本地可以连上,这台服务器上的别的程序也可以连接到这个数据库. 搞了半天实在不知道怎么办了, 求大神解答 ![图片说明](https://img-ask.csdn.net/upload/201712/05/1512466804_511876.jpg)

Java web开发中要是用jdbc连接access数据库,连接url怎么写相对位置

Java web开发中要是用jdbc连接access数据库,连接url怎么写相对位置,注意这里是jdbc方法连接 而不是jdbc-odbc 例如access数据库就在项目中(project文件夹下) 代码为: try { // 加载jdbc - odbc驱动 Class.forName("com.hxtt.sql.access.AccessDriver"); // 根据url创建连接实例 aConnection = DriverManager.getConnection("jdbc:Access://./BookStore.mdb"); // 创建statement实例 aStatement = aConnection.createStatement(); } catch (ClassNotFoundException e) { System.out.println(e); } catch (SQLException e) { System.out.println(e); } 我在做java的时候一直这样用就没问题 当时access数据库也是在项目文件夹下面,在 java web中为什么就会出错啊

JDBC连接数据库进行查询,将在后台显示的内容传到jsp页面

public class testDao { public void Select1(){ Connection con = null; PreparedStatement pst = null; ResultSet rs = null; java.sql.Date str1=null; try{ con = JdbcUtil12.getConnection(); String sql = "SELECT MAX(insert_time) as a FROM cdl_raw_1x_12217_atl32_sht_201702 t1"; pst = con.prepareStatement(sql); rs=pst.executeQuery(); while(rs.next()){ Date time1=new Date(rs.getTimestamp("a").getTime()); SimpleDateFormat formattime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String pubtime=formattime.format(time1); String dateStr = ""; if(dateStr.compareTo(pubtime)<0){ System.out.println("菏泽"+" "+pubtime+"正常"); }else{ System.out.println("菏泽"+" "+pubtime+"异常"); }} }catch(Exception e){ e.printStackTrace(); }finally{ JdbcUtil12.close(con, pst, rs); }; } public static void main(String[] args) throws ParseException{ Calendar now=Calendar.getInstance(); now.add(Calendar.HOUR,-4); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateStr=sdf.format(now.getTimeInMillis()); System.out.println("当前时间-4个小时:"+dateStr); new testDao().Select1(); } } 以上是用JDBC连接数据库进行查询,在后台输出打印的结果是:菏泽 2017-02-22 15:03:03正常 如何将在后台输出的结果输出到某个jsp页面

JDBC已成功连接到数据库,但是无法获取数据表的名称?

JDBC成功连接到数据库,我在逐步调式的时候,也看到生成的连接了。 ----- _**应老师的要求,要获取一个数据库中所有的表名称,下面是我写的一个函数,提示没有错误,但最后打印结果,为空。**_ ------- 图片的上一部分是另一个功能,足以证明以成功连接到数据库 ---- 求告知,可能出错的问题,在哪里? 下面是代码 ``` public static List<String> getAllTableNames( String databasename) { List<String> tableNames = new ArrayList<String>(); Connection conn1 = null; try { conn1 = getConnection(); DatabaseMetaData dbmd1 = conn1.getMetaData(); // 表名列表 ResultSet rest = dbmd1.getTables(databasename, null, null, new String[] { "TABLE" }); // 输出 table_name while (rest.next()) { tableNames.add(rest.getString("TABLE_NAME")); } } catch (SQLException e) { e.printStackTrace(); } return tableNames; } ``` ![图片说明](https://img-ask.csdn.net/upload/201911/20/1574255610_398525.png)

intellij idea 中javaweb 连 oracle错误

在Eclipse中运行正常的web应用,数据库连接正常(在Navicat中连接也是正常的),把项目移动到intellij idea中后报错: 2014-05-28 10:00:50,809 WARN (com.mchange.v2.resourcepool.BasicResourcePool:1841) - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6e68d505 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: Io �쳣: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) 2014-05-28 10:00:50,811 WARN (com.mchange.v2.resourcepool.BasicResourcePool:1841) - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4d24bd93 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: Io �쳣: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:254) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

javaweb项目连接本地数据库就没错,连接远程数据库(程序运行后登陆)就出错,数据都是一样的

严重: Servlet.service() for servlet [springMvc] in context with path [/BimoAPI] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin transaction failed: ] with root cause java.sql.SQLException: Couldn't perform the operation getAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs). at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207) at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)****

JAVA中使用JDBC做批量处理时,没有报错,但是数据没有插入数据库

@Override public void addAllEmp(List<Employee> employees) { Connection conn = null; PreparedStatement pst = null; try { conn = JDBCUtil.getConnect(); conn.setAutoCommit(false); pst = conn.prepareStatement("insert into jdbc_emp values(jdbc_emp_id.nextval,?,?,?"); int count = 0; for (Employee employee : employees) { pst.setString(1, employee.getName()); pst.setString(2, employee.getPassword()); pst.setDouble(3, employee.getSal()); count++; if (count==100) { //执行批处理 pst.executeBatch(); //清空参数 pst.clearParameters(); count = 0; } } pst.executeBatch(); conn.commit(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { /*if (conn != null) { try { conn.rollback(); } catch (SQLException e1) { e1.printStackTrace(); } }*/ // TODO Auto-generated catch block e.printStackTrace(); }finally{ JDBCUtil.close(conn, pst); }

javaweb 调用自己写的dll文件报错

[ERROR]-[Thread: http-nio-8080-exec-9]-[com.jfinal.core.ActionHandler.handle()]: /manage/order/edit/browser/NO2017051917015400000027 java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.jfinal.aop.Invocation.invoke(Invocation.java:85) at com.jianyi.mo2o.interceptor.OuterInterceptor.intercept(OuterInterceptor.java:15) at com.jfinal.aop.Invocation.invoke(Invocation.java:65) at com.jianyi.mo2o.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:19) at com.jfinal.aop.Invocation.invoke(Invocation.java:65) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.jfinal.aop.Invocation.invoke(Invocation.java:71) ... 24 more Caused by: java.lang.NoClassDefFoundError: com/sun/jna/Library at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2494) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:860) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2494) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:860) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at com.jianyi.mo2o.controller.OrderController.manage_order_edit_browser(OrderController.java:211) ... 29 more Caused by: java.lang.ClassNotFoundException: com.sun.jna.Library at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) ... 44 more

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Vue + Spring Boot 项目实战(十九):Web 项目优化解决方案

快来一起探索如何打脸我们的破项目,兄弟姐妹们把害怕打在公屏上!

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解!

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解! 目录 博客声明 大数据了解博主粉丝 博主的粉丝群体画像 粉丝群体性别比例、年龄分布 粉丝群体学历分布、职业分布、行业分布 国内、国外粉丝群体地域分布 博主的近期访问每日增量、粉丝每日增量 博客声明 因近期博主写专栏的文章越来越多,也越来越精细,逐步优化文章。因此,最近一段时间,订阅博主专栏的人数增长也非常快,并且专栏价

一个HashMap跟面试官扯了半个小时

一个HashMap能跟面试官扯上半个小时 关注 安琪拉的博客 1.回复面试领取面试资料 2.回复书籍领取技术电子书 3.回复交流领取技术电子书 前言 HashMap应该算是Java后端工程师面试的必问题,因为其中的知识点太多,很适合用来考察面试者的Java基础。 开场 面试官: 你先自我介绍一下吧! 安琪拉: 我是安琪拉,草丛三婊之一,最强中单(钟馗不服)!哦,不对,串场了,我是**,目...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

程序员是做全栈工程师好?还是专注一个领域好?

昨天,有位大一的同学私信我,说他要做全栈工程师。 我一听,这不害了孩子么,必须制止啊。 谁知,讲到最后,更确定了他做全栈程序员的梦想。 但凡做全栈工程师的,要么很惨,要么很牛! 但凡很牛的,绝不是一开始就是做全栈的! 全栈工程师听起来好听,但绝没有你想象的那么简单。 今天听我来给你唠,记得帮我点赞哦。 一、全栈工程师的职责 如果你学习编程的目的只是玩玩,那随意,想怎么学怎么学。...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

用了这个 IDE 插件,5分钟解决前后端联调!

点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!作者 |李海庆我是一个 Web 开发前端工程师,受到疫情影响,今天是我在家办公的第78天。开发了两周,...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

Java14 新特性解读

Java14 已于 2020 年 3 月 17 号发布,官方特性解读在这里:https://openjdk.java.net/projects/jdk/14/以下是个人对于特性的中文式...

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

工作两年简历写成这样,谁要你呀!

作者:小傅哥 博客:https://bugstack.cn 沉淀、分享、成长,让自己和他人都能有所收获! 一、前言 最近有伙伴问小傅哥,我的简历怎么投递了都没有反应,心里慌的很呀。 工作两年了目前的公司没有什么大项目,整天的维护别人的代码,有坑也不让重构,都烦死了。荒废我一身技能无处施展,投递的简历也没人看。我是不动物园里的猩猩,狒狒了! 我要加班,我要996,我要疯狂编码,求给我个机会… ...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问