jdbc连接oracle数据库失败

各位大神,这个问题卡好久了,数据库一直连不上,不多说,直接上代码:
jdbc.properties文件:

 jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
jdbc.url=jdbc:oracle:thin:@192.168.1.106:1521:orcl
jdbc.username=root
jdbc.password=root
jdbc.maxActive=50

tnsnames.ora文件:

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.106)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.254.209.161)
    )
  )

listener.ora文件:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\install\Oracle\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\install\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.106)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\install\Oracle

报错信息

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappedStatementStrategy' defined in file [C:\Users\Max\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\iPlat4j3\WEB-INF\classes\spring\framework\applicationContext-ibatis.xml]: Invocation of init method failed; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: The Network Adapter could not establish the connection)
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: The Network Adapter could not establish the connection)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: The Network Adapter could not establish the connection)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
    at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
    at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
    at org.springframework.jdbc.core.support.JdbcDaoSupport.getConnection(JdbcDaoSupport.java:119)
    at com.baosight.iplat4j.core.sqldao.impl.NamedSqlDaoSpringJdbcImpl.getDbConnection(NamedSqlDaoSpringJdbcImpl.java:364)
    at com.baosight.iplat4j.core.sqldao.impl.NamedSqlDaoDiagnoseImpl.getDbConnection(NamedSqlDaoDiagnoseImpl.java:81)
    at com.baosight.iplat4j.ep.MappedStatementStrategyWithPreLoadImpl.init(MappedStatementStrategyWithPreLoadImpl.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1160)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1122)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1085)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
    at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
    ... 34 more

基本可以确定是数据库问题或者是配置文件问题,因为之前用过是好的,换了一个数据库就不行了,而且plsql可以正常连接数据库

6个回答

检查ip和端口,是否已经启动数据库监听?

Max_Rzdq
Max_Rzdq ip和端口都看过了,没有问题,数据库监听也启了,不然plsql连不上去
接近 3 年之前 回复

tnsnames.ora 配置文件中SERVICE_NAME 没有是orcl ,jdbc.url=jdbc:oracle:thin:@192.168.1.106:1521:orcl orcl是跟service_name对应.

Max_Rzdq
Max_Rzdq 我试了一下,还是连不上啊。而且,改了之后反而plsql连接不上了
接近 3 年之前 回复

应该就是你配置文件里数据库名字不对,两边要一样的名字。

检查一下监听, 看看 service_name是不是 orcl.254.209.161
jdbc.url=jdbc:oracle:thin:@192.168.1.106:1521:orcl.254.209.161

Max_Rzdq
Max_Rzdq 下面是我用net manager看的,对吗
接近 3 年之前 回复

图片说明

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
.net连接oracle数据库

**一、**string strConnString = "Data Source=ORCL;User Id=admin;Password=ad min;"; Oracle.DataAccess.Client.OracleConnection OraCnn = new Oracle.DataAccess.Client.OracleConnection(); OraCnn.ConnectionString = strConnString; try { OraCnn.Open(); MessageBox.Show("连接成功"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { OraCnn.Dispose(); } **二、**string strConnString = "Data Source=ORCL;User Id=admin;Password=admin;"; System.Data.OracleClient.OracleConnection OraCnn = new System.Data.OracleClient.OracleConnection(strConnString); try { OraCnn.Open(); MessageBox.Show("连接成功"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { OraCnn.Dispose(); } 为什么“一”连接失败,显示错误消息“用户名或密码错误”,“二”可以登录成功?怎么解决呢?望各位大神赐教

java使用JDBC连接oracle数据库总是出错java io 异常 : the newtwork adapter could not establish

java使用JDBC连接oracle数据库总是出错java io 异常 : the newtwork adapter&nbsp; could not establish the connection <br /> <br /> <br />package staticUtil.db; <br /> <br />import java.sql.Connection; <br />import java.sql.DriverManager; <br />import java.sql.SQLException; <br /> <br />public class Database { <br /> <br /> static { <br /> try { <br /> // 1、加载oracle驱动程序 <br /> Class.forName("oracle.jdbc.OracleDriver"); <br /> } catch (ClassNotFoundException e) { <br /> e.printStackTrace(); <br /> <br /> } <br /> <br /> } <br /> <br /> private static String url = "jdbc:oracle:thin:@99.1.1.32:1521:ORCL"; <br /> private static String user = "nmc"; <br /> private static String password = "123456"; <br /> <br /> public static Connection getConnection(){ <br /> Connection connection = null; <br /> try { <br /> // 2、获取连接 <br /> connection = DriverManager.getConnection(url, user, password); <br />// System.out.println("连接成功"); <br /> } catch (SQLException e) { <br /> e.printStackTrace(); <br />// System.out.println("连接数据库失败!!"); <br /> } <br /> return connection; <br /> } <br /> <br />} <br /> <br />各方面检查都没有错,到底什么原因呢? <br />

java 用jdbc连接数据库 显示不存在的数据库

java 用jdbc连接数据库 显示不存在的数据库,可是我数据库明明就存在呀? ![图片说明](https://img-ask.csdn.net/upload/201808/03/1533280888_999122.png) ![图片说明](https://img-ask.csdn.net/upload/201808/03/1533280903_241629.png) ![图片说明](https://img-ask.csdn.net/upload/201808/03/1533281008_269340.png)

程序连接oracle数据库,运行报错提示ORA-12505

在我删掉workspace下的.metadata文件,再次创建的新workplace后,以前可以正常连接数据库的Java程序报错,提示java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

tomcat连接不上oracle数据库了

tomcat连接不上oracle数据库了 但是plsql能连接上 别人用电脑也能连接上 就是自己连接不上![图片说明](https://img-ask.csdn.net/upload/201805/05/1525531581_900070.png)

jdbc访问 oracle 诡异问题

问题:用jdbc连接数据oracle 失败,但是连接另一台服务器上的数据库没问题,并且无法连接的数据库通过plsql能正常连接 框架: springmvc+ mybatis

jdbc 连接oracle rac 一会连接的上一会连接不上的问题?

连接代码如下: [color=blue]Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String addrRAC = "(ADDRESS=(PROTOCOL=TCP)(HOST =10.0.5.62)(PORT =1521))(ADDRESS=(PROTOCOL=TCP)(HOST =10.0.5.60)(PORT =1521))"; String url = "jdbc:oracle:thin:@" + "(DESCRIPTION=" + "(ADDRESS_LIST=" + addrRAC + ")" + "(CONNECT_DATA=" + "(SERVER=DEDICATED)" + "(SERVICE_NAME=racdbs)" + ")" + ")"; Connection oracn = DriverManager.getConnection(url, "system","qz123456");[/color] [size=x-small]为什么一会连接的上一会连接不上,请大家给小弟一个意见。[/size]

jdbc连接数据库问题 结果连接出错 求大神指点啊 急急急

![图片说明](https://img-ask.csdn.net/upload/201608/22/1471834934_145091.png) 安装数据库出现这个问题 我找到相应的路径之后重新运行了一下那个bat文件 然后我自己写了一套jdbc public class ConnectOracle { static{ try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static Connection getCon(){ Connection con = null; try{ con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","123"); }catch(Exception e){ e.printStackTrace(); } return con ; } public static void main(String[] args) { Connection con = ConnectOracle.getCon(); System.out.println(con); } } 运行后的结果如图 ![图片说明](https://img-ask.csdn.net/upload/201608/22/1471834930_863214.png) 请问这是什么问题?

JDBC连接oracle 出问题:Listener refused the connection!

我现在在做一个小项目,环境是MYECLIPS6+TOMCAT5+ORACLE10g 当我在页面浏览时,总出现间接性的数据库连接错误,郁闷了很久。。 下面是MYECLIPSE中报的错误: java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: 192.168.133.250:1521:oracle at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:279) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:318) at oracle.jdbc.driver.PhysicalConnection. <init>(PhysicalConnection.java:343) at oracle.jdbc.driver.T4CConnection. <init>(T4CConnection.java:147) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:545) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at org.zjsoft.zjsj.util.Database.getConnection(Database.java:59) at org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:79) at org.zjsoft.zjsj.dao.impl.DepartmentDAOImpl.getDepartmentByID(DepartmentDAOImpl.java:41) at org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.setData(ApplyTypeDAOImpl.java:104) at org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.getApplyTypeByID(ApplyTypeDAOImpl.java:25) at org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.setDataList(ApplyDAOImpl.java:151) at org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.listApplyByStatus(ApplyDAOImpl.java:36) at org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doPost(AcceptStatusServlet.java:42) at org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doGet(AcceptStatusServlet.java:24) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.zjsoft.zjsj.filter.EncodingFilter.doFilter(EncodingFilter.java:25) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Unknown Source) 下面是我浏览器上显示的错误: java.lang.NullPointerException org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:81) org.zjsoft.zjsj.dao.impl.DepartmentDAOImpl.getDepartmentByID(DepartmentDAOImpl.java:41) org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.setData(ApplyTypeDAOImpl.java:104) org.zjsoft.zjsj.dao.impl.ApplyTypeDAOImpl.getApplyTypeByID(ApplyTypeDAOImpl.java:25) org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.setDataList(ApplyDAOImpl.java:151) org.zjsoft.zjsj.dao.impl.ApplyDAOImpl.listApplyByStatus(ApplyDAOImpl.java:36) org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doPost(AcceptStatusServlet.java:42) org.zjsoft.zjsj.servlet.accepter.AcceptStatusServlet.doGet(AcceptStatusServlet.java:24) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.zjsoft.zjsj.filter.EncodingFilter.doFilter(EncodingFilter.java:25) org.zjsoft.zjsj.util.Database.getPreparedStatement(Database.java:81)代码如下: private Connection getConnection() { Connection connection = null; try { Class.forName(DBDRIVER); // 加载数据库驱动类 } catch (ClassNotFoundException e) { e.printStackTrace(); } try { connection = DriverManager.getConnection(DBURL, USER, PASSWORD); } catch (SQLException e) { e.printStackTrace(); } return connection; } [b]问题补充:[/b] 项目都做了这么久了 不可能再改数据库了 修改连接试了下 连接数已经改为300了 但还是出现那个错误啊

JDBC连接Oracle出现异常

exception ``` org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database! org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause java.sql.SQLException: Connections could not be acquired from the underlying database! com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy11.find(Unknown Source) cn.itcast.jk.controller.basicinfo.factory.FactoryController.list(FactoryController.java:23) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ``` jdbc配置文件如下: ``` jdbc.driverClassName=oracle.jdbc.driver.OracleDriver jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:XE jdbc.username=system jdbc.password=lxw1993822 c3p0.pool.maxPoolSize=20 c3p0.pool.minPoolSize=5 c3p0.pool.initialPoolSize=3 c3p0.pool.acquireIncrement=2 ``` 我使用sqlplus和pl/sql都可以连接到数据库,但是在javaweb项目中,用jdbc连接却出现这个异常,求大神帮我看看,万分感谢!!!!

使用c3p0连接ORACLE数据库查询不到数据,SQLPLUS执行相同SQL可以查到

搭建一个webservice 使用c3p0连接oracle数据库,在执行查询语句,查询同一条数据的时候,有的时候查询不到结果,而有的时候查询到结果,服务还不报错,在使用SQLPLUS执行该语句的时候每次都能查到结果,求大神帮忙推测一下是什么问题。 使用c3p0创建一个静态的ComboPooledDataSource对象,当需要的时候从这里获取连接 Connection conn = comb.getConnection(); 数据库是按照日期建的分区表,执行查询语句的时候没有按照分区表查询,这会不会有影响。

java连接oracle异常(急求)

最近使用java连接oracle数据库的时候总会出现怪事情。几周前我用下面的代码能够连接上,并且能够在数据库中进行操作,代码如下: public class TTest { public static final String DBDRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String DBURL = "jdbc:oracle:thin:@localhost:1521:Miujg"; public static final String DBUSER = "scott"; public static final String PASSWORD = "tiger"; private Connection conn = null; public static void main(String[] args)throws Exception { Connection ct=null; Class.forName(DBDRIVER); ct=DriverManager.getConnection(DBURL,DBUSER,PASSWORD); System.out.println(ct); } } 现在连接总是出现: Io 异常: The Network Adapter could not establish the connection。网上说是没有打开那两个服务(一个是监听,另一个是OracleService),但是我都打开了的,昨晚我重新启动这两个服务又可以连接,但是今天我有照着昨天的做,还是不能够连接。我tm快疯了,求大神相助呀。

oracle数据库连接出错

![图片说明](https://img-ask.csdn.net/upload/201704/01/1491050563_658606.png)! java.lang.NoSuchMethodError: oracle.jdbc.OracleCallableStatement.setStringAtName(Ljava/lang/String;Ljava/lang/String;)V at oracle.dbtools.db.OracleUtil.checkAccess(OracleUtil.java:411) at oracle.dbtools.db.DBUtil.hasAccess(DBUtil.java:1898) at oracle.dbtools.raptor.query.QueryUtils.checkNonOracleAccess(QueryUtils.java:589) at oracle.dbtools.raptor.query.QueryUtils.getQuery(QueryUtils.java:399) at oracle.dbtools.raptor.query.QueryUtils.getQuery(QueryUtils.java:250) at oracle.dbtools.raptor.query.ObjectQueries.getQuery(ObjectQueries.java:43) at oracle.dbtools.raptor.navigator.db.xml.XmlObjectFactory.createFolderInstance(XmlObjectFactory.java:60) at oracle.dbtools.raptor.navigator.db.xml.XmlTypeOwnerInstance.listTypeFolders(XmlTypeOwnerInstance.java:93) at oracle.dbtools.raptor.navigator.db.impl.TypeContainerTreeNode.loadTypeFolders(TypeContainerTreeNode.java:111) at oracle.dbtools.raptor.navigator.db.impl.DatabaseTreeNode$LoadTask.doWork(DatabaseTreeNode.java:183) at oracle.dbtools.raptor.navigator.db.impl.DatabaseTreeNode$LoadTask.doWork(DatabaseTreeNode.java:112) at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:621) 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) [图片说明](https://img-ask.csdn.net/upload/201704/01/1491050060_403794.png) oracle.jdbc.OracleCallableStatement.setStringAtName(Ljava/lang/String;Ljava/lang/String;)V

java 用jdbc连接数据库的加载驱动问题

如果是连接sql语句的话,加在驱动的程序是这样的 Class.forName("com.mysql.jdbc.Driver"); 如果不使用mysql,假设用SQLyog,双引号中的驱动应该怎样改呢? 图下这种情况怎样解决呢? ![图片说明](https://img-ask.csdn.net/upload/201808/03/1533264662_305015.png)

Mybatis查询Oracle数据库结果为null,但数据库中存在该条记录

最近学习mybatis时遇到问题,相关配置应该是正确的,用mysql查询也能返回结果,但是将数据源切换到Oracle时总是返回null,求教。mybatis查询日志如下: ``` Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. PooledDataSource forcefully closed/removed all connections. PooledDataSource forcefully closed/removed all connections. PooledDataSource forcefully closed/removed all connections. PooledDataSource forcefully closed/removed all connections. Created connection 174573182. Returned connection 174573182 to pool. Opening JDBC Connection Checked out connection 174573182 from pool. Setting autocommit to false on JDBC Connection [oracle.jdbc.driver.T4CConnection@a67c67e] ==> Preparing: SELECT ID id, LAST_NAME lastName, GENDER gender, EMAIL email FROM mybatis_employee WHERE ID = ? ==> Parameters: 1(Integer) <== Total: 0 null Resetting autocommit to true on JDBC Connection [oracle.jdbc.driver.T4CConnection@a67c67e] Closing JDBC Connection [oracle.jdbc.driver.T4CConnection@a67c67e] Returned connection 174573182 to pool. ``` 但是,将mybatis发送的SQL复制到数据中直接查询也能查询到该记录。mybatis能返回null,可以说明Oracle数据库连接应该是没问题的,应该是结果的包装出了问题,相关代码描述如下文,求赐教。 Oracle中mybatis\_employee表定义如下: ```SQL ID INTEGER LAST\_NAME VARCHAR2(255) Y GENDER INTEGER Y EMAIL VARCHAR2(255) Y ``` mybatis对应的查询配置如下: ```xml <select id="getEmployeeById" resultType="cn.seu.edu.Mybatis.bean.Employee" databaseId="oracle"> SELECT ID id, LAST_NAME lastName, GENDER gender, EMAIL email FROM mybatis_employee WHERE ID = #{id} </select> ``` 测试代码如下: ```java public void testEmployeeMapper() throws IOException{ // 创建SqlSessionFactory对象 InputStream inputStream = Resources.getResourceAsStream("conf/mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); // 创建session SqlSession sqlSession = sqlSessionFactory.openSession(); Assert.assertNotNull(sqlSession); try { // 获取接口的实现类对象 // Mybatis会为接口实现一个代理对象,由代理对象执行sql EmployeeMapper employeeMapper = sqlSession.getMapper(EmployeeMapper.class); // 调用接口的方法 Employee employee = employeeMapper.getEmployeeById(1); System.out.println(employee); } finally { sqlSession.close(); } } ``` Employee类定义如下 ```java private Integer id; private String lastName; private Integer gender; private String email; 以下省略setter和getter ```

JDBC连接失败,报 invalid username/password

通过如下SQL创建一个用户 /*创建用户并指定表空间 */ create user FND_DATA identified by FND default tablespace FND_DATA; /*给用户授予权限 */ grant connect,resource to FND_DATA; PL/SQL可以正常登录,但是使用JDBC进行连接就会报错:invalid username/password Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbc:oracle:thin:@10.0.14.54:1521:SBP"; String user="FND_DATA"; String password="FND"; Properties info = new Properties(); info.put("user", user); info.put("password", password); Connection conn= DriverManager.getConnection(url, info); 请大家看看什么情况会导致这种错误

spring boot+druid连接oracle时总是报Connection reset错误

最近公司要把数据库从mysql转到oracl,于是在阿里云服务器上搭建了一oracle数据库。项目使用spring boot框架,数据库使用阿里的druid连接,参数如下: ``` url: jdbc:oracle:thin:@ip:1521/orcl username: test password: 123456 driver-class-name: oracle.jdbc.driver.OracleDriver initial-size: 1 max-active: 20 min-idle: 2 max-wait: 60000 pool-prepared-statements: true max-pool-prepared-statement-per-connection-size: 100 validation-query: SELECT 1 FROM dual validation-query-timeout: 5 test-on-borrow: true test-on-return: false test-while-idle: true time-between-eviction-runs-millis: 60000 min-evictable-idle-time-millis: 300000 connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 use-global-data-source-stat: true filters: stat,wall,log4j multi-statement-allow: true ``` 问题有两个: 1.开发时连接该数据库,启动时没问题,但是过一会儿就会出现断开重连的现象 2.把项目放在测试机(与oracle同台服务器)上启动时,每次启动第一次连接都会超时。 连接日志太长放在下面评论了

PLSQL登陆的问题报错ORA-28547:连接服务器失败,可能是Oracle Net管理错误

不填写数据库可以登陆,填写orcl报错这个![图片说明](https://img-ask.csdn.net/upload/201709/20/1505897285_126274.png)填写错误数据库报其他错误,连网络数据库没有问题,改listener.ora没好事阿,就是删了那一行,话说不填数据库是可以进去,但是eclipse没法链接阿jdbc.url=jdbc:oracle:thin:@localhost:1521:orcl,请大神指教

【求助】本地Oracle数据库连接不上

系统报错: oracle.javatools.db.DBException: java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection at oracle.jdevimpl.db.adapter.CADatabaseFactory.createConnectionImpl(CADatabaseFactory.java:66) at oracle.javatools.db.DatabaseFactory.createConnection(DatabaseFactory.java:534) at oracle.javatools.db.DatabaseFactory.createDatabase(DatabaseFactory.java:208) at oracle.jdeveloper.db.DatabaseConnections.getDatabase(DatabaseConnections.java:607) at oracle.dbtools.raptor.utils.Connections$ConnectionInfo.getDatabase(Connections.java:172) at oracle.dbtools.raptor.utils.Connections.getConnection(Connections.java:1064) at oracle.dbtools.raptor.utils.Connections.getConnection(Connections.java:1045) at oracle.dbtools.raptor.controls.DBConnectionComboBox$ConnectionOpener.doWork(DBConnectionComboBox.java:320) at oracle.dbtools.raptor.controls.DBConnectionComboBox$ConnectionOpener.doWork(DBConnectionComboBox.java:309) at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:515) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:475) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:552) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:253) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:526) at oracle.jdeveloper.db.adapter.AbstractConnectionCreator.getConnection(AbstractConnectionCreator.java:153) at oracle.dbtools.raptor.standalone.connection.RaptorConnectionCreator.getConnection(RaptorConnectionCreator.java:195) at oracle.dbtools.raptor.dialogs.conn.ConnectionPrompt.promptForPassword(ConnectionPrompt.java:67) at oracle.jdeveloper.db.adapter.DatabaseProvider.getConnection(DatabaseProvider.java:321) at oracle.jdeveloper.db.adapter.DatabaseProvider.getConnection(DatabaseProvider.java:254) at oracle.jdevimpl.db.adapter.CADatabaseFactory.createConnectionImpl(CADatabaseFactory.java:60) ... 18 more Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:439) at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:434) at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687) at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247) at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1126) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:337) ... 28 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:149) at oracle.net.nt.ConnOption.connect(ConnOption.java:133) at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:405) ... 33 more 求大神解答?

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java校招入职华为,半年后我跑路了

何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

@程序员:GitHub这个项目快薅羊毛

今天下午在朋友圈看到很多人都在发github的羊毛,一时没明白是怎么回事。 后来上百度搜索了一下,原来真有这回事,毕竟资源主义的羊毛不少啊,1000刀刷爆了朋友圈!不知道你们的朋友圈有没有看到类似的消息。 这到底是啥情况? 微软开发者平台GitHub 的一个区块链项目 Handshake ,搞了一个招募新会员的活动,面向GitHub 上前 25万名开发者派送 4,246.99 HNS币,大约价...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

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

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

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

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

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

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

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

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

立即提问
相关内容推荐