Error Calling Connection.preparestatement
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 2nd time calling PreparedStatement is not working after closing connection up vote 0 down vote favorite I'm trying to execute 2nd time PreparedStatement, but it fails if I close DriverManager.getConnection the code: public void getRates(String id) throws Exception, DBException { Connection conn = null; ResultSet rs = null; try { conn = getConnection(); if (ratesQueryStmt == null){ ratesQueryStmt = conn.prepareStatement(ratesQuery); } ratesQueryStmt.setString(1, id); ratesQueryStmt.setQueryTimeout(m_nTimeout); rs = ratesQueryStmt.executeQuery(); while (rs.next()){ System.out.println("!!!\n\nDATE = " + rs.getString("RATE_DAY") + " PURCHASE_PRICE = " + rs.getString("PURCHASE_PRICE") + " SELLING_PRICE = " + rs.getString("SELLING_PRICE")); } } catch (SQLException e) { Utility.trace(m_session, "SQL exception - code: "+String.valueOf(e.getErrorCode())+" "+e.getMessage()); throw e; } finally { DBAccess.closeEverything(rs, ratesQueryStmt, conn); //DO NOT WORK BECAUSE OF CLOSING CONNECTION (conn) } So first time it works just fine, but when I try call this method twice it shows error :( DBAccess.getInstance(mySession).getRates("USD"); //WORKS DBAccess.getInstance(mySession).getRates("EUR"); // NOT WORKING error stack java.lang.NullPointerException at oracle.jdbc.dbaccess.DBDataSetImpl._createOrGetDBItem(DBDataSetImpl.java:825) at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2520) at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1248) at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:1690) at asteros.DBAccess.get
크기 작게 보기 본문 폰트 크기 크게 보기 가 공감하기 공유하기 URL복사 번역하기 Error calling Connection.prepareStatement: http://stackoverflow.com/questions/7430858/2nd-time-calling-preparedstatement-is-not-working-after-closing-connection ibatis 에서 다중의 query를 날릴 경우, 나타났다. 원인은 mysql URL에 autocommit을 추가 안해서 나타났음 해결방안은 ibatis 설정파일에 reconnect 부분추가 property name="JDBC.ConnectionURL" http://m.blog.naver.com/sjpotato/40164290067 sqlmap-config.xml
최근에 올라온 글 Eclipse 4 Model에서 Rat... Java Autoupdater 중지... SVN에서 파일단위 체크아... Eclipse Indigo WTP + To... 일반 사용자계정에서 환... 최근에 달린 댓글 아 해결이 됐네요... 2014 good articles. 2014 thanks http://fordev.tistory.com/archive/201101 for share!. 2014 nice articles. 2014 고이 고이 퍼갑니다... 2013 최근에 받은 https://scn.sap.com/thread/3689217 트랙백 newsyzneta.pl. 2014 เจดีพูลส์. 2014 site. 2014 heart recipes. 2014 randki siedlce. 2014 글 보관함 2015/06 (1) 2015/05 (1) 2013/06 (1) 2013/01 (2) 2012/12 (1) 링크 人-ware(이충헌 차장). 데꾸벅의 즐거운날. Bee's log(김영진 과장). 박윤미. 최영목. 강병규. 박기영. 최인혜. calendar 이전다음 2011.01 일 월 화 수 목 금 error calling 토 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 티스토리 가입하기 RSS FEED 카테고리 분류 전체보기 (80) 넋두리 (4) 소프트웨어개발 (1) 소프트웨어아키텍처 (0) Cloud (8) error calling connection.preparestatement AWS (4) GAE (4) 프로그래밍언어 (8) Java (6) Java3D (0) JSON (1) 개발환경 (35) 이클립스 (21) WAS (2) 형상관리 (1) Build (3) Unix/Linux (2) 프레임워크 (11) Spring (3) Struts2 (0) iBATIS (3) Hibernate (0) 데이터베이스 (9) Oracle (5) MySql (1) MS SQL Server (2) 일반상식 (2) 금융상식 (1) '2011/01'에 해당되는 글 2건 2011.01.28 Adding multiple last resources is disallowed. 2011.01.26 Closing a statement you left open, please do your own housekeeping (2) 개발환경/WAS Adding multiple last resources is disallowed. 2011.01.28 12:16 | Posted by 포데브(엄지사랑) 엄지사랑 환경: JDK1.6.0_21 + JBoss EAP 4.3.2 + Spring 2.5.6 + iBatis 2.3.4 위의 환경에서 2개이상의 DataSource를 설정하고 JTA 트랜잭션을 설정했을 때 아래와 같은 에러가 발생했다. [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@473fc2 09:29:19,759[ERROR] (JakartaCommonsLoggingImpl.java:19) - Error calling Connection.prepareStatement: org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -3f57fff1:c23b:4d420dcd:e status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.tra
and SafetyAsset NetworkAsset Operations and MaintenanceCommerceOverviewSubscription Billing and Revenue ManagementMaster Data Management for CommerceOmnichannel CommerceFinanceOverviewAccounting and Financial CloseCollaborative Finance OperationsEnterprise Risk and ComplianceFinancial Planning and AnalysisTreasury and Financial Risk ManagementHuman ResourcesOverviewCore Human Resources and PayrollHuman Capital AnalyticsTalent ManagementTime and Attendance ManagementManufacturingOverviewManufacturing NetworkManufacturing OperationsResponsive ManufacturingMarketingOverviewMarket with Speed and AgilityUnique Customer ExperiencesReal-Time Customer InsightsR&D/EngineeringOverviewDesign NetworkDesign OrchestrationProject and Portfolio ManagementSalesOverviewCollaborative Quote to CashSales Force AutomationSales Performance ManagementSelling Through Contact CentersServiceOverviewEfficient Field Service ManagementOmnichannel Customer ServiceTransparent Service Process and OperationsSourcing and ProcurementOverviewContingent Workforce ManagementDirect ProcurementSelf-Service ProcurementServices ProcurementStrategic Sourcing and Supplier ManagementSupply ChainOverviewDemand ManagementDemand NetworkLogistics NetworkManufacturing Planning and SchedulingResponse NetworkResponse and Supply ManagementSales, Inventory, and Operations PlanningTransportation ManagementWarehouse ManagementSustainabilityOverviewEnvironment, Health, and SafetyProduct Safety and Stewardship NetworkBrowse by IndustryAerospace and DefenseAutomotiveBankingChemicalsConsumer ProductsDefense and SecurityEngineering, Construction, and OperationsHealthcareHigh TechHigher Education and ResearchIndustrial Machinery and ComponentsInsuranceLife SciencesMediaMill ProductsMiningOil and GasProfessional ServicesPublic SectorRetailSports and EntertainmentTelecommunicationsTravel and TransportationUtilitiesWholesale DistributionBrowse Platform and TechnologyAnalyticsOverviewBusiness IntelligencePredictive AnalyticsGovernance