hibernate连接oracle报错

Exception in thread "main" java.lang.AbstractMethodError: Method oracle/jdbc/driver/OracleDatabaseMetaData.supportsNamedParameters()Z is abstract

5个回答

你看看是不是你的驱动包的问题,该异常说的是:supportsNamedParameters()方法是一个抽象方法,也就是说,在类加载的时候没有加载到实现该方法的类!

驱动包太旧了,版本匹配问题

问题能贴的详细些吗?

1、驱动jar
2、连接配置问题

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
使用hibernate连接Oracle数据库报错
Exception in thread "main" org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473) at day1.test.DemoTest.main(DemoTest.java:51) 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:414) 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 java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:187) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 5 more
hibernate 连接数据库报错 获取xml失败 求大佬帮忙看一下
## 这是 hibernate.cfg.xml <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url">jdbc:oracle:thin:@localhost:1521:ORCL</property> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.username">Reust</property> <property name="connection.password">kingstar</property> <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="show_sql">true</property> <property name="format_sql">true</property> <property name="hbm2ddl.auto">update</property><!-- create --> <mapping resource="cd/entity/Igendpd.hbm.xml"/> <mapping resource="cd/entity/Iguser.hbm.xml"/> </session-factory> </hibernate-configuration> ## ## 这是hbm.xml <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="cd.entity.Igendpd" table="ig_end_pd" ><!-- schema="数据库对象集合名称" --><!-- dynamic-update="true" --><!-- select-before-update="true" --> <id name="igendId" type="Integer"> <column name="ig_end_id" /> <generator class="sequence"> <param name="sequence">SEQ_IG_END_PD</param> </generator> </id> <property name="igendSex" type="string"> <column name="ig_end_sex"> <comment>性别</comment> </column> </property> </class> </hibernate-mapping> <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="cd.entity.Iguser" table="ig_user" ><!-- schema="数据库对象集合名称" --><!-- dynamic-update="true" --><!-- select-before-update="true" --> <id name="igId" type="Integer"> <column name="ig_id" /> <generator class="sequence"> <param name="sequence">SEQ_IG_USER</param> </generator> </id> <property name="igtrueNmae" type="string"> <column name="ig_true_name"> <comment>真实姓名</comment> </column> </property> <property name="iglogName" type="string"> <column name="ig_log_name"> <comment>登陆姓名</comment> </column> </property> <property name="igAge" type="Integer"> <column name="ig_age"> <comment>年龄</comment> </column> </property> <property name="igendID" type="Integer"> <column name="ig_end_id"> <comment>性别ID</comment> </column> </property> <property name="igPwassd" type="string"> <column name="ig_pwassd"> <comment>密码</comment> </column> </property> </class> </hibernate-mapping> 这是 Configuration conf = new Configuration().configure(); 获取seesion 并测试** package meg; import java.util.List; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import cd.dao.ResultDao; import cd.entity.Iguser; public class Test { // 会话工厂 protected static SessionFactory sessionFactory = null; // 绑定到线程的集合 protected static ThreadLocal<Session> sessionThreadLocal = new ThreadLocal<Session>(); public static Session getSession() { Session session = null; if (sessionThreadLocal != null) { session = sessionThreadLocal.get(); } if (session == null) { if (sessionFactory == null) { Configuration conf = new Configuration(); conf.configure(); sessionFactory = conf.buildSessionFactory(); } session = sessionFactory.openSession(); if (sessionThreadLocal == null) { sessionThreadLocal = new ThreadLocal<Session>(); } sessionThreadLocal.set(session); } return session; } public static void main(String[] args) { Test ts=new Test(); ts.getSession(); System.out.print("连接成功"); } } ** 最后这是报错啊 ** 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration boolean -> org.hibernate.type.BooleanType@ba2e48 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration boolean -> org.hibernate.type.BooleanType@ba2e48 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Boolean -> org.hibernate.type.BooleanType@ba2e48 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration numeric_boolean -> org.hibernate.type.NumericBooleanType@130c8e9 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration true_false -> org.hibernate.type.TrueFalseType@9ed91f 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration yes_no -> org.hibernate.type.YesNoType@11a59ce 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration byte -> org.hibernate.type.ByteType@85a863 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration byte -> org.hibernate.type.ByteType@85a863 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Byte -> org.hibernate.type.ByteType@85a863 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration character -> org.hibernate.type.CharacterType@33aa9b 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration char -> org.hibernate.type.CharacterType@33aa9b 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Character -> org.hibernate.type.CharacterType@33aa9b 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration short -> org.hibernate.type.ShortType@1f920cf 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration short -> org.hibernate.type.ShortType@1f920cf 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Short -> org.hibernate.type.ShortType@1f920cf 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration integer -> org.hibernate.type.IntegerType@1773a14 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration int -> org.hibernate.type.IntegerType@1773a14 2018-11-14 17:35:44,433 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Integer -> org.hibernate.type.IntegerType@1773a14 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration long -> org.hibernate.type.LongType@a5ce92 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration long -> org.hibernate.type.LongType@a5ce92 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Long -> org.hibernate.type.LongType@a5ce92 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration float -> org.hibernate.type.FloatType@1bfefb 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration float -> org.hibernate.type.FloatType@1bfefb 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Float -> org.hibernate.type.FloatType@1bfefb 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration double -> org.hibernate.type.DoubleType@5c18ff 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration double -> org.hibernate.type.DoubleType@5c18ff 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Double -> org.hibernate.type.DoubleType@5c18ff 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration big_decimal -> org.hibernate.type.BigDecimalType@ae4f8b 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.math.BigDecimal -> org.hibernate.type.BigDecimalType@ae4f8b 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration big_integer -> org.hibernate.type.BigIntegerType@3d12a6 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.math.BigInteger -> org.hibernate.type.BigIntegerType@3d12a6 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration string -> org.hibernate.type.StringType@e8f27e 2018-11-14 17:35:44,443 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.String -> org.hibernate.type.StringType@e8f27e 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration url -> org.hibernate.type.UrlType@113e371 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.net.URL -> org.hibernate.type.UrlType@113e371 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration date -> org.hibernate.type.DateType@93886b 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.sql.Date -> org.hibernate.type.DateType@93886b 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration time -> org.hibernate.type.TimeType@3c0737 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.sql.Time -> org.hibernate.type.TimeType@3c0737 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration timestamp -> org.hibernate.type.TimestampType@9da1dd 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.sql.Timestamp -> org.hibernate.type.TimestampType@9da1dd 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.Date -> org.hibernate.type.TimestampType@9da1dd 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration dbtimestamp -> org.hibernate.type.DbTimestampType@9db0ad 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration calendar -> org.hibernate.type.CalendarType@1644028 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.Calendar -> org.hibernate.type.CalendarType@1644028 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.GregorianCalendar -> org.hibernate.type.CalendarType@1644028 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration calendar_date -> org.hibernate.type.CalendarDateType@15268d7 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration locale -> org.hibernate.type.LocaleType@b0a518 2018-11-14 17:35:44,453 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.Locale -> org.hibernate.type.LocaleType@b0a518 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration currency -> org.hibernate.type.CurrencyType@1313e0e 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.Currency -> org.hibernate.type.CurrencyType@1313e0e 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration timezone -> org.hibernate.type.TimeZoneType@2a2ae9 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.TimeZone -> org.hibernate.type.TimeZoneType@2a2ae9 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration class -> org.hibernate.type.ClassType@d4a1d3 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.lang.Class -> org.hibernate.type.ClassType@d4a1d3 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration uuid-binary -> org.hibernate.type.UUIDBinaryType@7f1228 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.util.UUID -> org.hibernate.type.UUIDBinaryType@7f1228 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration uuid-char -> org.hibernate.type.UUIDCharType@d200d8 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration pg-uuid -> org.hibernate.type.PostgresUUIDType@1f854bd 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration binary -> org.hibernate.type.BinaryType@1672313 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration byte[] -> org.hibernate.type.BinaryType@1672313 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration [B -> org.hibernate.type.BinaryType@1672313 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration wrapper-binary -> org.hibernate.type.WrapperBinaryType@1542cdc 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration Byte[] -> org.hibernate.type.WrapperBinaryType@1542cdc 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration [Ljava.lang.Byte; -> org.hibernate.type.WrapperBinaryType@1542cdc 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration image -> org.hibernate.type.ImageType@c2060e 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration characters -> org.hibernate.type.CharArrayType@75d174 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration char[] -> org.hibernate.type.CharArrayType@75d174 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration [C -> org.hibernate.type.CharArrayType@75d174 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration wrapper-characters -> org.hibernate.type.CharacterArrayType@13638d4 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration [Ljava.lang.Character; -> org.hibernate.type.CharacterArrayType@13638d4 2018-11-14 17:35:44,463 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration Character[] -> org.hibernate.type.CharacterArrayType@13638d4 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration text -> org.hibernate.type.TextType@1b271f1 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration blob -> org.hibernate.type.BlobType@5f00f9 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.sql.Blob -> org.hibernate.type.BlobType@5f00f9 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration materialized_blob -> org.hibernate.type.MaterializedBlobType@1535ac 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration wrapper_materialized_blob -> org.hibernate.type.WrappedMaterializedBlobType@293b53 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration clob -> org.hibernate.type.ClobType@101f287 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration java.sql.Clob -> org.hibernate.type.ClobType@101f287 2018-11-14 17:35:44,473 DEBUG [org.hibernate.type.BasicTypeRegistry] - Adding type registration materialized_clob -> org.hibernate.type.MaterializedClobType@d8f55c Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE at org.hibernate.type.BasicTypeRegistry.<init>(BasicTypeRegistry.java:94) at org.hibernate.type.TypeResolver.<init>(TypeResolver.java:59) at org.hibernate.cfg.Configuration.<init>(Configuration.java:250) at org.hibernate.cfg.Configuration.<init>(Configuration.java:302) at meg.Test.getSession(Test.java:30) at meg.Test.main(Test.java:45) # # 我直接写测试方法是能测试通的 但是写成hibernate.cfg.xml就不行了 下面是我直接在java中写的 public static void main(String[] args) { Connection con;//声明Connection对象 Statement sql; ResultSet res ; try { Class.forName("oracle.jdbc.driver.OracleDriver");//加载数据库驱动 // System.out.print("加载数据库驱动成功"); } catch (ClassNotFoundException e) { e.printStackTrace(); } try { con=DriverManager.getConnection("jdbc:oracle:" + "thin:@127.0.0.1:1521:ORCL","Reust","kingstar"); // System.out.print("数据库连接成功"); } catch (SQLException e) { // TODO: handle exception e.printStackTrace(); } } }
Hibernate 连接数据库, oracle jdbc 连接
我在配置文件中 写明了 name 为 root ![图片说明](https://img-ask.csdn.net/upload/201501/13/1421144652_360862.jpg) 在我启动服务器的时候, Hibernate 报错 却是 去我的 另一个账户下面找表, 当然找不到, 然后就给我报错。 (root 账户下是有表的, 另一个账户没有) 这是什么原因呢? 我现在删除了 那个账户 就好了, 他为什么去我 那个账户下面找? 很不解 , 我对Hibernate 的机制不是很了解, 解决办法就是删除那个账户就好了, 但是原理一点都不懂。 我做过的事: svn 进行了项目的整合, 所以我就把本地项目删除,然后重新ckeck, 数据库中的 用户我也删除重新建的, 刚开始错误用 dba的角色近数据库 建表, 然后没找到 ,报错正常。后来我以normal 登录,建表 就出现了刚才的描述的错误, 我感觉应该和这个有关, 可是我不了解 原理! 求 大神能给我指点。 谢谢, 虽然误打误撞 解决了, 可是还是不舒服啊
Hibernate连接数据库出错
为什么我的hibernate都能查询oracle数据库里面的东西,也执行了hql语句,但是在query.list()的时候会报错,是不是驱动错了?求大神指点一下啊,下面的是异常 org.hibernate.exception.GenericJDBCException: could not execute query org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) org.hibernate.loader.Loader.doList(Loader.java:2235) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) org.hibernate.loader.Loader.list(Loader.java:2124) org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149) org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) com.sneaker.daoimpl.CustomerDaoImpl.login(CustomerDaoImpl.java:29) com.sneaker.service.CustomerService.login(CustomerService.java:20) com.sneaker.action.CustomerAction.login(CustomerAction.java:42) ..... java.sql.SQLException: ???? oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208) oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:7465) oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:103) oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:521) oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1563) org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:236) org.hibernate.type.IntegerType.get(IntegerType.java:51) org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184) org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173) org.hibernate.type.AbstractType.hydrate(AbstractType.java:105) org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114) org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404) org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332) org.hibernate.loader.Loader.getRow(Loader.java:1230) org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603) org.hibernate.loader.Loader.doQuery(Loader.java:724) org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) org.hibernate.loader.Loader.doList(Loader.java:2232) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) org.hibernate.loader.Loader.list(Loader.java:2124) org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401) org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1149) org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) com.sneaker.daoimpl.CustomerDaoImpl.login(CustomerDaoImpl.java:29) com.sneaker.service.CustomerService.login(CustomerService.java:20) com.sneaker.action.CustomerAction.login(CustomerAction.java:42) ...
SSH中做hibernate映射表时报错:unknow Oracle major version
想问各位大师一个问题: 我在SSH中做hibernate映射表时报错:unknow Oracle major version[0] Oracle version为10g、MyEclipse6.5、spring2.0、Hibernate3.0 hibernate是交给spring的配置文件applicationContext.xml管理的 好象只要是hibernate没有自己单独的配置文件.就会报这样的错.相反.只要hibernate有自己单独的配置文件的话.即使加了spring框架.再去从oracle中映射表的时候就不会报错. spring配置文件中的有关hibernate的配置信息如下: #applicationContext.xml <bean id="datasource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property> <property name="url" value="jdbc:oracle:thin:@localhost:1521:MYORCL"></property> <property name="username" value="SCOTT"></property> <property name="password" value="tiger"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="datasource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> [color=red]org.hibernate.dialect.Oracle9Dialect[/color] <!--我的oracle是oracle10g.但IDE自动生成的是oracle9的方言.但即使我改为9i、10、10g之类的也不行.--> </prop> </props> </property> </bean> 我个人认为: 1.这不是数据库驱动的问题.因为如上我说.只是在hibernate用spring的配置文件时出错其他时没有错.所以并不是连接不上数据库的问题.(我用的是ojdbc14.jar包,jdbc12.jar包出现这个问题后,我用了ojdbc14.jar包依然没有解决) 2.好多都说是oracle方言的问题.但我一直不明白为什么只是出现在把hibernate用spring的配置文件时会出现这个问题.而且如果有hibernate的单独配置文件的话.hibernate.cfg.xml中的方言属性不也是IDE自动生成的吗.我并没有改过.但却没有问题出现阿?而且在spring配置文件中同样也会自动生成这个方言属性阿.是和单独的hibernate配置文件中生成的一样阿!并不是说没有阿!(所以应该不是IDE的问题)所以我就有个疑问:难道hibernate框架一定要有一个自己单独的配置文件吗?但如果确是方言问题.请您说清楚一下到底怎样改.在哪个文件里改 2.也不是什么工程目录下那些框架的一些.myhibernatedata这样的配置文件的问题.因为我打开看了.里面写的hibernate就是用的spring的配置文件applicationContext.xml.说明hibernate框架知道自己现在用的是spring的配置文件.并不是hibernate框架不知道自己的配置文件:不信.这个文件的内容如下.(都是IDE自动自动生成的): .myhibernatedata文件内容: # #Sat Dec 27 12:53:30 CST 2008 genBasicCompId=false sessionFactoryName= profile= daoSFId=sessionFactory version=3.0 jndiPath= detectM2M=false reStrategyClass=[size=medium][/size][size=large][/size] springDaoFile=src/yaye/net/conf/applicationContext.xml useJavaTypes=true keyGenerator=assigned libInstallFolder=/WebRoot/WEB-INF/lib addLibs2Project=true genVersionTag=false sessionFactoryId=sessionFactory basePersistenceClass= reSettingsFile= configFile=/login-spring/src/yaye/net/conf/applicationContext.xml createConfigFile=false addLibs2Classpath=true 3.也不题路径的问题.我都仔细检查过了.路径没有错. 不甚感激.
mysql换成oracle报错
最近把写的项目从mysql5.5换成oracle 11g,采用hibernate3.5.5+spring3.1.1+struts2.3.4,c3p 0.9连接池,当初用mysql没什么问题,换成oracle的主键增长,jdbc配置都已经改了。用户登录没问题,登录成功后从数据库查询东西的时候,出现 Exception in thread "http-bio-9999-exec-8" java.lang.OutOfMemoryError: PermGen space 请问下,出现这个问题的原因是什么,我需要做哪些修改
springboot 配置hibernate 开始使用的是mysql,都正常,但是换成Oracle后总是创建表。
springboot 配置hibernate 开始使用的是mysql,都正常,但是换成Oracle后总是创建表。所以后台报如下表重复错误。这是为什么呀?应该是如果发现表已经有的话不应该再创建才对,请帮我看下哪里配置错了。 再详细说明下我的场景: 数据库映射的对象Product。 第一次系统启动肯定会创建一个,因为数据库中是没有这个表,然后系统重启或者再次启动,正常来讲,Product对象没有改过,数据库表也存在,hibernate不应该再创建,但是目前就是再创建,所以报表名已经有的错误。 ``` Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: 名称已由现有对象使用 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) ~[ojdbc-6.6.0.jar:11.2.0.4.0] at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[ojdbc-6.6.0.jar:11.2.0.4.0] at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951) ~[ojdbc-6.6.0.jar:11.2.0.4.0] ``` ``` server: port: 8001 spring: application: name: DEMO_TEST #f服务名称定义 datasource: type: com.alibaba.druid.pool.DruidDataSource # 当前数据源操作类型 #driver-class-name: com.mysql.cj.jdbc.Driver # mysql驱动包 driver-class-name: oracle.jdbc.driver.OracleDriver #url: jdbc:mysql://127.0.0.1:3306/rd_plm?serverTimezone=GMT%2B8 # 数据库名称 url: jdbc:oracle:thin:@127.0.0.1:1521/DD username: root password: root dbcp2: min-idle: 5 # 数据库连接池的最小维持连接数 initial-size: 5 # 初始化连接数 max-total: 5 # 最大连接数 max-wait-millis: 150 # 等待连接获取的最大超时时间 jpa: hibernate: naming: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl ddl-auto: update show-sql: true properties: hibernate: #dialect: org.hibernate.dialect.MariaDBDialect dialect: org.hibernate.dialect.OracleDialect current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext #database: MYSQL database: oracle open-in-view: true ```
shh框架连接Oracle数据库报流已被关闭什么原因啊
我连接MySql数据库是工作流正常的,改成Oracle数据库后第一次初始化时没报错的,再启动就出现以下问题了!哪位大侠帮帮看看的!谢谢的! Hibernate: select resources0_.DEPLOYMENT_ as DEPLOYMENT4_12_1_, resources0_.DBID_ as DBID1_1_, resources0_.NAME_ as NAME5_1_, resources0_.DBID_ as DBID1_2_0_, resources0_.DBVERSION_ as DBVERSION2_2_0_, resources0_.BLOB_VALUE_ as BLOB3_2_0_ from JBPM4_LOB resources0_ where resources0_.DEPLOYMENT_=? [chaosZ] ERROR [main] org.hibernate.util.JDBCExceptionReporter.logExceptions(234) | 流已被关闭 [chaosZ] ERROR [main] com.chaosZ.common.LoadOnStartup.init(30) | could not initialize a collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#1] org.hibernate.exception.GenericJDBCException: could not initialize a collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#1] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.loadCollection(Loader.java:2173) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111) at org.hibernate.collection.PersistentMap.keySet(PersistentMap.java:249) at org.jbpm.pvm.internal.repository.DeploymentImpl.getResourceNames(DeploymentImpl.java:166) 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:601) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197) at org.jbpm.pvm.internal.repository.DeploymentImpl_$$_javassist_61.getResourceNames(DeploymentImpl_$$_javassist_61.java) at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:59) at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46) at org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:130) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.getProcessDefinition(ProcessDefinitionQueryImpl.java:92) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:80) at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:83) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56) at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:64) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:157) at com.chaosZ.service.impl.admin.ApproveFlowServiceImpl.initApproveFlow(ApproveFlowServiceImpl.java:62) 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:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy56.initApproveFlow(Unknown Source) at com.chaosZ.common.LoadOnStartup.gInitApproveFlow(LoadOnStartup.java:47) at com.chaosZ.common.LoadOnStartup.init(LoadOnStartup.java:23) at javax.servlet.GenericServlet.init(GenericServlet.java:151) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1005) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4529) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4809) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:785) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:763) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:557) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1124) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1047) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:542) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:355) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:313) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:293) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:996) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:988) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:427) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:649) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.startup.Catalina.start(Catalina.java:585) 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:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Caused by: java.sql.SQLException: 流已被关闭 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:208) at oracle.jdbc.driver.LongAccessor.getBytes(LongAccessor.java:151) at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:193) at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:426) at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:403) at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342) at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61) at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230) at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:768) at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:281) at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1156) at org.hibernate.loader.Loader.readCollectionElements(Loader.java:774) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:622) at org.hibernate.loader.Loader.doQuery(Loader.java:829) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.loadCollection(Loader.java:2166) ... 79 more org.hibernate.exception.GenericJDBCException: could not initialize a collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#1] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.loadCollection(Loader.java:2173) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111) at org.hibernate.collection.PersistentMap.keySet(PersistentMap.java:249) at org.jbpm.pvm.internal.repository.DeploymentImpl.getResourceNames(DeploymentImpl.java:166) 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:601) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197) at org.jbpm.pvm.internal.repository.DeploymentImpl_$$_javassist_61.getResourceNames(DeploymentImpl_$$_javassist_61.java) at org.jbpm.pvm.internal.repository.ProcessDeployer.deploy(ProcessDeployer.java:59) at org.jbpm.pvm.internal.repository.DeployerManager.deploy(DeployerManager.java:46) at org.jbpm.pvm.internal.repository.RepositorySessionImpl.getObject(RepositorySessionImpl.java:130) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.getProcessDefinition(ProcessDefinitionQueryImpl.java:92) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:80) at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:83) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56) at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:64) at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:157) at com.chaosZ.service.impl.admin.ApproveFlowServiceImpl.initApproveFlow(ApproveFlowServiceImpl.java:62) 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:601) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy56.initApproveFlow(Unknown Source) at com.chaosZ.common.LoadOnStartup.gInitApproveFlow(LoadOnStartup.java:47) at com.chaosZ.common.LoadOnStartup.init(LoadOnStartup.java:23) at javax.servlet.GenericServlet.init(GenericServlet.java:151) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1118) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1005) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4529) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4809) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:785) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:763) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:557) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1124) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1047) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:542) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:355) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:313) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:293) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:996) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:988) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:427) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:649) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139) at org.apache.catalina.startup.Catalina.start(Catalina.java:585) 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:601) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Caused by: java.sql.SQLException: 流已被关闭 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:208) at oracle.jdbc.driver.LongAccessor.getBytes(LongAccessor.java:151) at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:193) at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:426) at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:403) at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515) at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342) at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61) at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230) at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:768) at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:281) at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1156) at org.hibernate.loader.Loader.readCollectionElements(Loader.java:774) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:622) at org.hibernate.loader.Loader.doQuery(Loader.java:829) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.loadCollection(Loader.java:2166) ... 79 more
oracle 8i hibernate生成映射文件时报错
hibernate3.1 生成oracle8i映射文件报如下错 <br />An internal error occurred during: "Generating Artifacts". <br />Could not get list of tables from database. Probably a JDBC driver problem. <br />Configured schema:MIND <br />Configured catalog:null <br />Available schemas: <br />  DBSNMP <br />  MIND <br />  MIND4 <br />  OUTLN <br />  SYS <br />  SYSTEM <br />Available catalogs: <br /><br /><strong>问题补充:</strong><br />hibernate3.1 生成oracle8i映射文件报如下错 <br /><br />An internal error occurred during: "Generating Artifacts". <br /><br />Could not get list of tables from database. Probably a JDBC driver problem. <br /><br />Configured schema:MIND <br /><br />Configured catalog:null <br /><br />Available schemas: <br /><br />? DBSNMP <br /><br />? MIND <br /><br />? MIND4 <br /><br />? OUTLN <br /><br />? SYS <br /><br />? SYSTEM <br /><br />Available catalogs: <br /><br /> <br /> <br /> <br />连接上了数据库 <br />可以看到表 <br />但是生成映射文件就报上面的错误<br /><strong>问题补充:</strong><br /># <br />#Mon Nov 10 09:20:36 CST 2008 <br />genBasicCompId=true <br />sessionFactoryName=com.by.bfm.hibernate.HibernateSessionFactory <br />profile= <br />daoSFId=sessionFactory <br />version=3.1 <br />jndiPath= <br />detectM2M=false <br />reStrategyClass= <br />springDaoFile=src/com/by/bfm/spring/applicationContext.xml <br />useJavaTypes=true <br />keyGenerator=increment <br />libInstallFolder=/WebRoot/WEB-INF/lib <br />addLibs2Project=true <br />genVersionTag=false <br />sessionFactoryId= <br />basePersistenceClass= <br />reSettingsFile=/BFM/hibernate.reveng.xml <br />configFile=/BFM/src/com/by/bfm/hibernate/hibernate.cfg.xml <br />createConfigFile=true <br />addLibs2Classpath=true <br /> <br />内容如下 <br />没有乱呀
hibernate oracle11g blob java.sql.SQLRecoverableException
类中字段注解如下: [code="java"] @Column(name = "CONTENT1") @NotNull private java.sql.Blob content; [/code] 我在保存的时候没有报错,但在读取的时候就报错了,代码如下: [code="java"]IOUtils.copy(testObject.getContent().getBinaryStream(), out);[/code] 错误信息如下: [code="java"]java.sql.SQLRecoverableException: 关闭的连接 at oracle.sql.BLOB.getDBAccess(BLOB.java:1071) at oracle.sql.BLOB.getBinaryStream(BLOB.java:248)[/code] 困扰了很长时间 谢谢各位^_^
spring +Hibernate配置连接数据库,
org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed at org.springframework.orm.hibernate4.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:579) Caused by: org.hibernate.TransactionException: rollback failed at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.rollback(AbstractTransactionImpl.java:215) Caused by: org.hibernate.TransactionException: unable to rollback against JDBC connection at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.doRollback(JdbcTransaction.java:167) Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset at oracle.jdbc.driver.T4CConnection.doRollback(T4CConnection.java:650) Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:196) Caused by: java.sql.SQLRecoverableException: IO Error: Connection timed out at oracle.jdbc.driver.T4CConnection.doRollback(T4CConnection.java:650) Caused by: java.net.SocketException: Connection timed out at java.net.SocketInputStream.socketRead0(Native Method) 是每次重启了Tomcat过段时间登录就会出现这个错误,重启后有段时间是正常的,在本地代码报错的是一个很简单的查询语句,在windows环境下能正常运行,在linux下隔断时间就会出现这个错误,用的容器是Tomcat
sql server 连接不上 一直报错
我是本地sqlsever在本地连接 ![图片说明](https://img-ask.csdn.net/upload/201908/08/1565258866_609274.png)![图片说明](https://img-ask.csdn.net/upload/201908/08/1565258874_509180.png) ssms可以连接 ![图片说明](https://img-ask.csdn.net/upload/201908/08/1565258899_339497.png) ![图片说明](https://img-ask.csdn.net/upload/201908/09/1565312312_745270.png)![图片说明](https://img-ask.csdn.net/upload/201908/09/1565312318_667065.png) 上面添加入站规则不是开启端口吗? ![图片说明](https://img-ask.csdn.net/upload/201908/09/1565312459_27330.png)
spring配置方式管理hibernate事务的情况下,每过一段时间产生的错误
项目的背景是struts2+spring+hibernate3 weblogic服务器集群环境 数据库oracle spring管理hibernate 采用配置的方式,配置在了service层。 数据库连接方面使用了hibernate自带的连接池(用其他第三方连接池也试了,问题依旧) 现象:每过一段时间便会报错:(部分) jdbc rollback failed ... TransactionException: JDBC commit failed ... java.sql.SQLRecoverableException: No more data to read from socket ... 错误发生的地方大致在dao层,之中有一个方法,我使用的spring注入的 sessionFactory.getCurrentSession(),然后调用其connection()方法,再使用prepareCall(...)调用存储过程,返回结果。 大致的情况如上。从现象上看像是连接池没有释放的样子,但是我已经在方法最后调用的session.close() rs.close() cstmt.close(); 还是会报错。我猜想是否是因为spring管理事务自动关闭session等和我使用hibernaete的session调用存储过程的方式有什么不协调的地方导致的。请高手帮我提供下思路和解决方案。我没有什么c币和奖分,这个该死的问题已经困扰了我三个星期了,我非常愿意为提供正确产生原因并最终成功解决问题的朋友直接100软妹币的感谢!
求大神,求大神,求大神,求大神,spring配置多租户错误,去掉多租户配置不报错。
7-23 13:04:58,761 ERROR DriverManagerConnectionProviderImpl - HHH000152: JDBC URL was not specified by property hibernate.connection.url 07-23 13:04:58,801 ERROR ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: HHH000152: JDBC URL was not specified by property hibernate.connection.url at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:684) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827) --------------------文件配置去掉多租户配置不报错 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass"> <value>oracle.jdbc.driver.OracleDriver</value> </property> <property name="jdbcUrl"> <value>jdbc:oracle:thin:@localhost:1521:myoracle</value> </property> <property name="user"> <value>shulizhi</value> </property> <property name="password"> <value>shulizhi</value> </property> <!-- 连接池中保留的最小连接数。--> <property name="minPoolSize"> <value>5</value> </property> <!--连接池中保留的最大连接数。Default: 15 --> <property name="maxPoolSize"> <value>50</value> </property> <!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 --> <property name="initialPoolSize"> <value>5</value> </property> <!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 --> <property name="maxIdleTime"> <value>30</value> </property> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 --> <property name="acquireIncrement"> <value>5</value> </property> <!-- JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements 属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。 如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 <property name="maxStatements"> <value>0</value> </property> --> <property name="maxStatements"> <value>0</value> </property> <property name="maxStatementsPerConnection"> <value>100</value> </property> <!--每60秒检查所有连接池中的空闲连接。Default: 0 --> <property name="idleConnectionTestPeriod"> <value>60</value> </property> <!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 --> <property name="acquireRetryAttempts"> <value>30</value> </property> <!-- 获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试 获取连接失败后该数据源将申明已断开并永久关闭。Default: false --> <property name="breakAfterAcquireFailure"> <value>false</value> </property> <!-- 因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的 时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable 等方法来提升连接测试的性能。Default: false <property name="testConnectionOnCheckout"> <value>false</value> </property> --> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.generate_statistics">true</prop> <prop key="hibernate.connection.release_mode">auto</prop> <prop key="hibernate.autoReconnect">true</prop> <prop key="hibernate.jdbc.batch_size">30</prop> <prop key="hibernate.multiTenancy">SCHEMA</prop> <prop key="hibernate.tenant_identifier_resolver">hotel.dao.hibernate.TenantIdResolver</prop> <prop key="hibernate.multi_tenant_connection_provider">hotel.dao.hibernate.SchemaBasedMultiTenantConnectionProvider</prop> </props> </property> <property name="mappingDirectoryLocations"> <list> <value>classpath:com/buddha/domain/</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <context:annotation-config /> <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource"> <ref bean="dataSource" /> </property> </bean> </beans>
连oracle 数据库是报Got minus one from a read call错误
现在有个项目 数据库设计了负载均衡 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = datadb) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) ) 有一个spring+hibernate的系统连接是就报 DEBUG (JDBCExceptionReporter.java:63) - SQL Exception org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: Got minus one from a read call) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:825) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:751) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) 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:3827) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Caused by: java.sql.SQLException: Io 异常: Got minus one from a read call at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314) 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) ... 42 more WARN (JDBCExceptionReporter.java:71) - SQL Error: 0, SQLState: null 也找不到什么原因。 [b]问题补充:[/b] 现在有个项目 数据库设计了负载均衡 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.3)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = datadb) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) ) 有一个spring+hibernate的系统连接是就报 DEBUG (JDBCExceptionReporter.java:63) - SQL Exception org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Io 异常: Got minus one from a read call) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:855) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:825) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:751) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) 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:3827) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4343) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Caused by: java.sql.SQLException: Io 异常: Got minus one from a read call at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333) at oracle.jdbc.driver.OracleConnection.&lt;init>(OracleConnection.java:404) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314) 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) ... 42 more WARN (JDBCExceptionReporter.java:71) - SQL Error: 0, SQLState: null 也找不到什么原因。 是的 我们用jndi的配置就是这么用的 <parameter> <name>url</name> <value>jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.2)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.3)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ecarddb) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) ) ) )</value> </parameter> 就是个别参数不知道正不正确failover=yes 需要指定? [b]问题补充:[/b] 晕倒 终于搞定了 非常感谢jones的东西 我进行比对 发现我指定了(SERVER = DEDICATED) 这个应该是某一台机器的名称 我把这个去了 就可以了 (不过疑虑还有有的,我们有好几个应用系统,用了同样的url连接都可以,就是一个系统报错。所以我开始没有怀疑url的问题)
java.sql.SQLRecoverableException: Closed Connection
各位大佬,求教,我使用DBCP连接池时出现 java.sql.SQLRecoverableException: Closed Connection 报错。经过百度后知道,该错误是连接长时间不用,自动断开了。再次使用该连接时就会出现这个错误。 目前我修改了DBCP的配置文件,如下。请问这样配置之后能不能解决该问题,我使用的是oracle数据库 ``` driverClassName= url= username= password= # 连接池启动时创建的初始化连接数量 initialSize=20 # 连接池中可同时连接的最大连接数量 maxActive=20 # 连接池中最大的空闲连接数量,超过的空闲连接将被释放,设置为负数表示不限制 maxIdle=8 # 连接池中最小的空闲连接数量,低于这个数量将创建新的连接 minIdle=5 # 最大等待时间,当没有可用连接时,连接池等待连接释放的最大时间 maxWait=10000 # 是否在归还到池中进行检验 testOnReturn=false # 校验语句,必须是查询语句,至少查询一列,设置了它onBorrow才会生效 validationQuery=select 1 from dual # 连接是否被空闲连接回收器(如果有)进行检验.如果检测失败, # 则连接将被从池中去除.设置为true后如果要生效,validationQuery参数必须设置为非空字符串 testWhileIdle=true # 从池中取出连接时完成校验 ,验证不通过销毁这个connection,默认为true, testOnBorrow=false # 每30秒运行一次空闲连接回收器 timeBetweenEvictionRunsMillis=30000 # 连接在池中保持空闲而不被空闲连接回收器线程 # (如果有)回收的最小时间值,单位毫秒 minEvictableIdleTimeMillis=1800000 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量 numTestsPerEvictionRun=3 # 校验查询时长,如果超过,认为校验失败 validationQueryTimeout=1 # 设置是否自动提交 defaultAutoCommit=flase ```
SQL Error: 17008, SQLState: null
每次程序运行一段时间以后,就报此错 08-08-17 09:55:29 WARN JDBCExceptionReporter:71 - SQL Error: 17008, SQLState: null 08-08-17 09:55:29 ERROR JDBCExceptionReporter:72 - 关闭的连接 08-08-17 09:55:29 WARN JDBCExceptionReporter:71 - SQL Error: 17008, SQLState: null 08-08-17 09:55:29 ERROR JDBCExceptionReporter:72 - 关闭的连接 org.hibernate.exception.GenericJDBCException: could not execute query Caused by: java.sql.SQLException: 关闭的连接 我的的struts2 +hibernate3 dao是 public Userinfo checkUserinfo(String name, String pwd) { Session session = HibernateSessionFactory.getSession(); Transaction ta = session.beginTransaction(); Userinfo userinfo = (Userinfo) session.createCriteria(Userinfo.class) .add(Expression.eq("userinfoName", name)).add( Expression.eq("userinfoPassword", pwd)).uniqueResult(); ta.commit(); HibernateSessionFactory.closeSession(); return userinfo; } [b]问题补充:[/b] package com.shop.hibernate.util; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.cfg.Configuration; /** * Configures and provides access to Hibernate sessions, tied to the * current thread of execution. Follows the Thread Local Session * pattern, see {@link http://hibernate.org/42.html }. */ public class HibernateSessionFactory { /** * Location of hibernate.cfg.xml file. * Location should be on the classpath as Hibernate uses * #resourceAsStream style lookup for its configuration file. * The default classpath location of the hibernate config file is * in the default package. Use #setConfigFile() to update * the location of the configuration file for the current session. */ private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml"; private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>(); private static Configuration configuration = new Configuration(); private static org.hibernate.SessionFactory sessionFactory; private static String configFile = CONFIG_FILE_LOCATION; static { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } private HibernateSessionFactory() { } /** * Returns the ThreadLocal Session instance. Lazy initialize * the <code>SessionFactory</code> if needed. * * @return Session * @throws HibernateException */ public static Session getSession() throws HibernateException { Session session = (Session) threadLocal.get(); if (session == null || !session.isOpen()) { if (sessionFactory == null) { rebuildSessionFactory(); } session = (sessionFactory != null) ? sessionFactory.openSession() : null; threadLocal.set(session); } return session; } /** * Rebuild hibernate session factory * */ public static void rebuildSessionFactory() { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } /** * Close the single hibernate session instance. * * @throws HibernateException */ public static void closeSession() throws HibernateException { Session session = (Session) threadLocal.get(); threadLocal.set(null); if (session != null) { session.close(); } } /** * return session factory * */ public static org.hibernate.SessionFactory getSessionFactory() { return sessionFactory; } /** * return session factory * * session factory will be rebuilded in the next call */ public static void setConfigFile(String configFile) { HibernateSessionFactory.configFile = configFile; sessionFactory = null; } /** * return hibernate configuration * */ public static Configuration getConfiguration() { return configuration; } } 这是自动生成的 [b]问题补充:[/b] ------------------------------------------------------ Caused by: java.sql.SQLException: 关闭的连接 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:895) at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:802) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162) at org.hibernate.loader.Loader.doQuery(Loader.java:390) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) at org.hibernate.loader.Loader.doList(Loader.java:1593) ... 122 more
WEBLOGIC的BUG??? 关闭的连接
各位达人,最近在生产环境上碰到一个很奇异的问题: 生产环境: weblogic815集群, oracle9i集群... 操作: 更改数据库的密码, 更改weblogic连接池的密码, 重新启动weblogic(受管和管理服务器), 未重启oracle(不能重启) 现象: 有一些操作正常, 但是有一些操作报错,错误信息如下 [code="java"] java.sql.SQLException: 关闭的连接 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :227) at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnectio n.java:930) at weblogic.jdbc.wrapper.PoolConnection.setAutoCommit(PoolConnection.jav a:141) at net.sf.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTra nsaction.java:104) at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction .java:95) at common.blh.XcBLH.execute(XcBLH.java:99) at common.bizDelegate.FakeDelegate.invokeTask(FakeDelegate.java:58) at common.bizDelegate.FakeDelegate.delegate(FakeDelegate.java:24) at gov.gwssi.xcweb.common.XCAction.execute(XCAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148 2) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.DoTimeoutFilter.doFilter(DoTimeoutFilt er.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.SetCharacterEncodingFilter.doFilter(Se tCharacterEncodingFilter.java:59) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) common.exception.XcBlException: at gov.gwssi.xccore.blh.business.zhcx.PretreatYcfpZhcxBlh.performTask(Pr etreatYcfpZhcxBlh.java:76) at common.blh.XcBLH.execute(XcBLH.java:61) at common.bizDelegate.FakeDelegate.invokeTask(FakeDelegate.java:58) at common.bizDelegate.FakeDelegate.delegate(FakeDelegate.java:24) at gov.gwssi.xcweb.common.XCAction.execute(XCAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148 2) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.DoTimeoutFilter.doFilter(DoTimeoutFilt er.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.SetCharacterEncodingFilter.doFilter(Se tCharacterEncodingFilter.java:59) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) 当前jsp的URI:/dkpz/default/syserror.jsp <2008-11-12 上午10时00分01秒 CST> <Error> <JDBC> <BEA-001112> <Test "SELECT 1 FR OM DUAL" set up for pool "DkpzPool1" failed with exception: "java.sql.SQLExcepti on: 必须登录到服务器".> [/code] 敬请达人们指点 [b]问题补充:[/b] 各位达人,最近在生产环境上碰到一个很奇异的问题: 生产环境: weblogic815集群, oracle9i集群... 操作: 更改数据库的密码, 更改weblogic连接池的密码, 重新启动weblogic(受管和管理服务器), 未重启oracle(不能重启) 现象: 有一些操作正常, 但是有一些操作报错,错误信息如下 [code="java"] ERROR [ExecuteThread: '11' for queue: 'weblogic.kernel.Default'] (JDBCTransactio n.java:90) - Rollback failed java.sql.SQLException: 关闭的连接 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :227) at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.jav a:1031) at weblogic.jdbc.wrapper.PoolConnection_oracle_jdbc_driver_T4CConnection .rollback(Unknown Source) at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction .java:86) at common.blh.XcBLH.execute(XcBLH.java:99) at common.bizDelegate.FakeDelegate.invokeTask(FakeDelegate.java:58) at common.bizDelegate.FakeDelegate.delegate(FakeDelegate.java:24) at gov.gwssi.xcweb.common.XCAction.execute(XCAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148 2) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.DoTimeoutFilter.doFilter(DoTimeoutFilt er.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.SetCharacterEncodingFilter.doFilter(Se tCharacterEncodingFilter.java:59) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) ERROR [ExecuteThread: '11' for queue: 'weblogic.kernel.Default'] (JDBCTransactio n.java:108) - Could not toggle autocommit java.sql.SQLException: 关闭的连接 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java :227) at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnectio n.java:930) at weblogic.jdbc.wrapper.PoolConnection.setAutoCommit(PoolConnection.jav a:141) at net.sf.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTra nsaction.java:104) at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction .java:95) at common.blh.XcBLH.execute(XcBLH.java:99) at common.bizDelegate.FakeDelegate.invokeTask(FakeDelegate.java:58) at common.bizDelegate.FakeDelegate.delegate(FakeDelegate.java:24) at gov.gwssi.xcweb.common.XCAction.execute(XCAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148 2) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.DoTimeoutFilter.doFilter(DoTimeoutFilt er.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.SetCharacterEncodingFilter.doFilter(Se tCharacterEncodingFilter.java:59) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) common.exception.XcBlException: at gov.gwssi.xccore.blh.business.zhcx.PretreatYcfpZhcxBlh.performTask(Pr etreatYcfpZhcxBlh.java:76) at common.blh.XcBLH.execute(XcBLH.java:61) at common.bizDelegate.FakeDelegate.invokeTask(FakeDelegate.java:58) at common.bizDelegate.FakeDelegate.delegate(FakeDelegate.java:24) at gov.gwssi.xcweb.common.XCAction.execute(XCAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148 2) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run (ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm pl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.DoTimeoutFilter.doFilter(DoTimeoutFilt er.java:27) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at gov.gwssi.xcweb.common.filters.SetCharacterEncodingFilter.doFilter(Se tCharacterEncodingFilter.java:59) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja va:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio n.run(WebAppServletContext.java:6987) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate dSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java: 121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe rvletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm pl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) 当前jsp的URI:/dkpz/default/syserror.jsp <2008-11-12 上午10时00分01秒 CST> <Error> <JDBC> <BEA-001112> <Test "SELECT 1 FR OM DUAL" set up for pool "DkpzPool1" failed with exception: "java.sql.SQLExcepti on: 必须登录到服务器".> [/code] 敬请达人们指点 [b]问题补充:[/b] 之前只设置了Test Reserved Connections 但是刚刚把 Test Reserved Connections Test Created Connections Test Released Connections 都设置上了也不行 [b]问题补充:[/b] oracle没有超过连接数,任何时候都只有 特定的 业务模块才会出现这种现象,其它的模块没有 而有问题的业务的实现方式与正常的实现方式是一样的 [b]问题补充:[/b] Web用的是Struts1.2, 持久层用的是Hibernate,封装的Session. 具体的流程是 BaseAction是一个基于Struts的模板模式,里面通过代理来调用业务逻辑方法 在代理中,首先获取一个hibernate的session,hibernate引用的是WEBLOGIC配置的数据源,用之前创建,用完后关闭(只关闭session,没有关闭对应的连接) 也就是说,在进行业务操作之前,都会新创建一个会话 另外,出现问题的业务模板与正常的业务模块都是基于这种框架 public abstract class BaseAction{ final ... execute(...){ ... prepareRequest();////这是个抽象方法,处理请求的数据 .....////这儿通过代理调用业务方法,即BaseBlh.performTask() processResponse(...);/////抽象方法,处理业务生成的数据 abstract DTO prepareRequest(...); abstract ActionForward processResponse(...); } public abstract class BaseBlh(){ abstract DTO performTask(Session session); } public BlhProxy{ public DTO performTask(...){ Session session = ////通过hibernate获取,用的是Weblogic配置的数据源 BaseBlh blh = ...../////2.通过反射,获取当前具体的业务类 DTO dto = blh.performTask(session); session.close(); return dto; ////这里面省略了事务等等的操作 } } 不知道我描述清楚了没有 再次谢谢 [b]问题补充:[/b] 另外,就是在进行数据库密码修改之前,一切正常 [b]问题补充:[/b] to: bohemia 非常感谢你的关注, 今天去了一趟生产环境的现场, 通过日志(之前的异常信息是技术支持传过来的)发现, 在业务操作过程中, 有一个过程出现问题 抛出了 ora-00600 internal error code [...] [][][][] 异常 导致程序没能正常执行 但是存储过程编译没有出现任何问题,经过排查,发现,在存储过程中有一个游标 select column1, column2...., functionName(...) columnN from tableName; 无法执行,将其单独执行抛出ora-00600异常 后来将functionName(...) columnN这一列去掉后,查询正常. 此时, 发现, 通过plsql直接打开(利用右键)时,居然提示该函数不存在!!! 但是该函数的确存在,并且编译存储过程也没有任何问题. 通过其它方式打开该函数,尝试重新编译, 重新查询, 问题解决. 问题虽然解决,但是还是有几个疑问: 1. 为什么函数functionName(...)为出现这个问题 2. 为什么在oracle出现异常后连接会关闭 [b]问题补充:[/b] ora-00600是一个oracle内容错误,出现错误的原因在oracle日志里面给的不是很详细,现在虽然找着了解决问题的办法. 另外,在业务操作的过程中,每一次操作之前获取一个连接,这个连接是有效的,但是在oracle抛出了那个ora-00600异常之后,这个连接居然"自动"断开了,很是费解, 因为业务操作过程是这样子的 1. 打开连接,开启事务 2.1 业务操作a 需要访问数据库 2.2 业务操作b 需要访问数据库 3. 提交(回滚)事务,关闭连接 在整个流程中,只有步骤3才会关闭连接,而在2.1操作抛出ora-00600错误后,再进行2.2操作时,就发现连接已经断开了
struts配置c3p0连接池出错
希望在struts+hibernate的项目中既用struts的jdbc连接池又用hibernate的连接池,用dbcp可以同时使用,因为hibernate配置的是c3p0,所以想把struts连接池也用c3p0,在struts-config.xml中写下如下配置: <data-source key="datasource" type="com.mchange.v2.c3p0.ComboPooledDataSource"> <set-property property="password" value="abc" /> <set-property property="username" value="abc" /> <set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver" /> <set-property property="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:test" /> <set-property property="minPoolSize" value="10" /> <set-property property="maxPoolSize" value="20" /> <set-property property="initialPoolSize" value="10" /> </data-source> 运行后报错: java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at com.struts_learn.dao.ArticleDAO.delete(ArticleDAO.java:162) at com.struts_learn.action.ArticleManageAction.doAction(ArticleManageAction.java:47) at com.struts_learn.action.CommonAction.execute(CommonAction.java:24) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) 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 com.struts_learn.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:29) 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) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 37 more [b]问题补充:[/b] 本地测试,肯定连接没超,我怀疑struts能不能用c3p0的连接池,如果能那就是配置错了..不过实在不知道错在哪,貌似没有人用struts+c3p0..
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
源码阅读(19):Java中主要的Map结构——HashMap容器(下1)
(接上文《源码阅读(18):Java中主要的Map结构——HashMap容器(中)》) 3.4.4、HashMap添加K-V键值对(红黑树方式) 上文我们介绍了在HashMap中table数组的某个索引位上,基于单向链表添加新的K-V键值对对象(HashMap.Node&lt;K, V&gt;类的实例),但是我们同时知道在某些的场景下,HashMap中table数据的某个索引位上,数据是按照红黑树
c++制作的植物大战僵尸,开源,一代二代结合游戏
    此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材,少部分搜集于网络,以及自己制作。 此游戏为同人游戏而且仅供学习交流使用,任何人未经授权,不得对本游戏进行更改、盗用等,否则后果自负。 目前有六种僵尸和六种植物,植物和僵尸的动画都是本人做的。qq:2117610943 开源代码下载 提取码:3vzm 点击下载--&gt; 11月28日 新增四种植物 统一植物画风,全部修
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
深度学习图像算法在内容安全领域的应用
互联网给人们生活带来便利的同时也隐含了大量不良信息,防范互联网平台有害内容传播引起了多方面的高度关注。本次演讲从技术层面分享网易易盾在内容安全领域的算法实践经验,包括深度学习图
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程实用技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法,并会持续更新。
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
"狗屁不通文章生成器"登顶GitHub热榜,分分钟写出万字形式主义大作
前言 GitHub 被誉为全球最大的同性交友网站,……,陪伴我们已经走过 10+ 年时间,它托管了大量的软件代码,同时也承载了程序员无尽的欢乐。 上周给大家分享了一篇10个让你笑的合不拢嘴的Github项目,而且还拿了7万+个Star哦,有兴趣的朋友,可以看看, 印象最深刻的是 “ 呼吸不止,码字不停 ”: 老实交代,你是不是经常准备写个技术博客,打开word后瞬间灵感便秘,码不出字? 有什么
推荐几款比较实用的工具,网站
1.盘百度PanDownload 这个云盘工具是免费的,可以进行资源搜索,提速(偶尔会抽风????) 不要去某站买付费的???? PanDownload下载地址 2.BeJSON 这是一款拥有各种在线工具的网站,推荐它的主要原因是网站简洁,功能齐全,广告相比其他广告好太多了 bejson网站 3.二维码美化 这个网站的二维码美化很好看,网站界面也很...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
相关热词 c#选择结构应用基本算法 c# 收到udp包后回包 c#oracle 头文件 c# 序列化对象 自定义 c# tcp 心跳 c# ice连接服务端 c# md5 解密 c# 文字导航控件 c#注册dll文件 c#安装.net
立即提问