spring-jdbc

Spring JDBC Template. How can get outcome variables of the pl/sql script

∥☆過路亽.° 提交于 2019-12-08 19:15:38
I am using NamedParameterJdbcTemplate for run pl/sql script. But I don't know how can I get the values ​​of out variables ( :id_out ). Thanks in advance. String script = "declare begin if myFunc(:id_in) is null then :id_out := 0; else :id_out := 1; end if; end;"; Map<String,Object> bindVars = new HashMap<String, Object>(); bindVars.put(id_in,1); bindVars.put(id_out,2); jdbcTmpl.execute(script, bindVars, new PreparedStatementCallback<Object>() { @Override public Object doInPreparedStatement(PreparedStatement cs) throws SQLException, DataAccessException { cs.execute(); return null; } } ); I don

Spring StoredProcedure with Oracle array : ORA-01000: maximum open cursors exceeded

你离开我真会死。 提交于 2019-12-08 16:51:34
问题 When calling an Oracle stored procedure with OracleTypes.ARRAY input parameter multiple times, getting the following error :- org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call EMP_SCHEMA.GET_EMPLOYEE_LIST(?, ?)}]; SQL state [72000]; error code [1000]; ORA-01000: maximum open cursors exceeded; nested exception is java.sql.SQLException: ORA-01000: maximum open cursors exceeded at org.springframework.jdbc.support

JdbcTemplate - SQLWarning ignored: SQL state '22007', error code '1292', message [Truncated incorrect DOUBLE value: 'stepExecutionContext[toId]']

筅森魡賤 提交于 2019-12-08 10:58:22
问题 I am simply developing the Spring Batch partitioned code looking at http://www.mkyong.com/spring-batch/spring-batch-partitioning-example/ and already went through the link : Error Code 1292 - Truncated incorrect DOUBLE value - Mysql but it did not solved my purpose. I have the following bean <bean id="pagingItemReader" class="org.springframework.batch.item.database.JdbcPagingItemReader" scope="step"> <property name="dataSource" ref="dataSource" /> <property name="pageSize" value="200" />

Spring JDBC Template- How to retrieve multiple result with multiple parameters with a single query

依然范特西╮ 提交于 2019-12-08 09:33:10
问题 I have a simple query which is select distinct roleid,firstname,lastname where role_id='210'; I am using the same query for fetching the different lists such as projectnames ,projectmanagers name,developers...etc..based on the roleid that I am passing. My problem is I need to run the above query in a single shot by passing all the roleid and retrieve them in a single hit and assign those list to different list such as managers list ,developers list ,testers list ..etc and send it to the UI

Spring JDBC with Tomcat DBCP and multiple datasources

那年仲夏 提交于 2019-12-08 08:17:39
I am using spring with have multiple datasources (catering to multiple mysql dbs) and using tomcat dbcp. I am getting some weird exceptions like procedure not found - when the proc is definitely present in the db cannot borrow from pool - local dev setup, so definitely the pool is not full the Problem I feel might be this, need inputs from everyone: I have one jdbcTemplate object defined in my spring.xml , on every query that I need to fire, I call jdbcTemplate.setDataSource() to set the appropriate datasource and then use simplejdbccall(jdbctemplate) to execute the proc. Should I go in for

Spring Batch JdbcPagingItemReader seems not paginating

陌路散爱 提交于 2019-12-08 07:29:01
问题 I'm working on an app that indexes a bunch of files in an embedded Derby(10.12.1.1) DB and then are exported as one single tabulated file. The first part is working fine since the DB is created and all records are indexed. However, when I attempt to read from the DB using JdbcPagingItemReader and write to a file I only get the number of records specified in pageSize . So if the pageSize is 10, then I get a file with 10 lines and the rest of the records seem to be ignored. So far, I haven't

NamedJDBCTemplate Parameters is list of lists

两盒软妹~` 提交于 2019-12-08 07:12:48
问题 I have a query which looks something like this: SELECT * FROM someTable t WHERE (t.a, t.b) IN (VALUES (1, 2), (3, 4)) And it would select any records where t.a == 1 AND t.b == 2 or t.a == 3 AND t.b == 4 . This seems to work just fine. However, I can't figure out a clean way to specify the parameter to NamedJDBCTemplate . I tried giving it a list of lists (i.e., List<List<int>> ), but it seems to blow up doing that. val query = "SELECT * FROM someTable t WHERE (t.a, t.b) IN (VALUES :values)"

Spring JDBC with Tomcat DBCP and multiple datasources

断了今生、忘了曾经 提交于 2019-12-08 06:27:57
问题 I am using spring with have multiple datasources (catering to multiple mysql dbs) and using tomcat dbcp. I am getting some weird exceptions like procedure not found - when the proc is definitely present in the db cannot borrow from pool - local dev setup, so definitely the pool is not full the Problem I feel might be this, need inputs from everyone: I have one jdbcTemplate object defined in my spring.xml , on every query that I need to fire, I call jdbcTemplate.setDataSource() to set the

Setting up an oracle connection pool using spring in Mule ee 3.2.2

不打扰是莪最后的温柔 提交于 2019-12-08 04:41:19
问题 Mule is really neato but the rigid shared xsd stuff with spring never seems to play nice. The horrible documentation offered up by Mulesoft is continuing to be...Horrible. I am trying to get a connection pool setup since each query that runs for my service simple takes too long to instantiate. I am forced to fire up 9 queries per service call and the lag from not having a pool affects performance in a bad way. For the dataSource I have tried many different oracle v6 classes but I always seem

Spring Oauth2 JDBC Client configuration add same client multiple times

给你一囗甜甜゛ 提交于 2019-12-08 04:02:10
问题 I am configuring an OAuth2 authorization server in a Spring project. Here is configuration. @Override public void configure(ClientDetailsServiceConfigurer clients) throws Exception { clients.jdbc(dataSource) .withClient("user") .secret("secret") .scopes("read", "write") .autoApprove(true) .authorizedGrantTypes( "password","authorization_code", "refresh_token") } The problem is that each time I restart application, it tries to add those clients in database, which I don't want. I am getting the