JdbcTemplate 3 « Database « Spring Q&A





1. JdbcTemplate with expr IN (value,...)    forum.springsource.org

Hi all I'm using the JdbCTemplate method Code: query(String sql, Object[] args, RowMapper rowMapper) to return a List of objects from a MySQL database. I'd like to pass a set of ...

2. Problem with JdbcTemplate    forum.springsource.org

Problem with JdbcTemplate Hi All, I am using spring framework to work with database. I am updating a table in a loop using JdbcTemplate. If there are any execption in any ...

3. problem with JDBCTemplate like statement.    forum.springsource.org

problem with JDBCTemplate like statement. This is a strange one, possibly a bug? Basically I have a query with a like statement. I am using the named parameter jdbc template to ...

4. Application hangs up randomly in jdbcTemplate.query() / update()    forum.springsource.org

Application hangs up randomly in jdbcTemplate.query() / update() Hello! I am experiencing random problems with Spring's JDBC template while trying to retrieve data from a database and/or updating data. I am ...

5. Idea for new JdbcTemplate method    forum.springsource.org

Idea for new JdbcTemplate method Hi, I'm a fan of the JdbcTemplate, but there is one helper method I've needed that I've had to code into an extension of it. I ...

6. Multiple getBean calls for jdbcTemplate    forum.springsource.org

Multiple getBean calls for jdbcTemplate I have a fairly generic question/advice-seeking-post for uses of jdbcTemplate. I have a created a simple persistence API using jdbcTemplate and transactionalizing all work using org.springframework.transaction.interceptor.Transa ...

7. how to pass JDBCTemplate to valang custom function?    forum.springsource.org

Hi I have a custom valang function just as the one in the MultiOrderJob.xml example Code: The problem is that I want ...

8. jdbcTemplate to produce object graph    forum.springsource.org

9. JdbcTemplate vs. Raw JDBC performance    forum.springsource.org

JdbcTemplate vs. Raw JDBC performance So I was investigating a performance issue we were having in our application. Our app makes extensive use of JdbcTemplate. After profiling I got some incredible ...





10. JdbcTemplate.query( string, object[], RowCallbackHandler ) not binding parameters?    forum.springsource.org

JdbcTemplate.query( string, object[], RowCallbackHandler ) not binding parameters? I'm using JdbcTemplate.query( string, object[], RowCallbackHandler ) and it seems that the template isn't binding the parameters in the object[] to the parameter ...

11. Best practice for using jdbctemplate from command line application    forum.springsource.org

Best practice for using jdbctemplate from command line application Is there a best practice for using jdbctemplate from a java command line application? We want to use jdbctemplate in our DAO ...

12. null jdbcTemplate in AbstractJpaTests    forum.springsource.org

I have created a test that extends AbstractJpaTests but when I try to access the jdbcTemplate, it is null. I do have a dataSource bean defined. My service (that uses a ...

13. any way to get connection info from JdbcTemplate at runtime?    forum.springsource.org

I have a Java application that uses Spring beans to assess persistence, and I want to dig into the managed JdbcTemplate to somehow display the jdbc url to the user at ...

14. Help with jee / JdbcTemplate / Apache Tomcat.    forum.springsource.org

Oct 22nd, 2008, 10:58 AM #1 Brian French View Profile View Forum Posts Private Message Junior Member Join Date Oct 2008 Posts 13 Help with jee / JdbcTemplate / Apache Tomcat. ...

15. jdbctemplate call does not use my index    forum.springsource.org

I am using oracle9 db Can someone explain me why the next call (which uses a prepared statement I think) does not use my index on accountnumber. The second one does. ...

16. Using jdbcTemplate with manual TX commit    forum.springsource.org

Using jdbcTemplate with manual TX commit I would like to take advantage of the spring jdbc template with a C3P0 datasource but do not want to have to use spring to ...





17. Use of ConnectionCallback with JdbcTemplate Execute()    forum.springsource.org

Use of ConnectionCallback with JdbcTemplate Execute() Hi, I would like to get advice for the code snippet I did below. jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection connection) throws SQLException, DataAccessException { ...

18. Use of ConnectionCallback with JdbcTemplate execute()    forum.springsource.org

Use of ConnectionCallback with JdbcTemplate execute() Hi, I would like to get advice for the code snippet I did below. jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection connection) throws SQLException, DataAccessException { ...

19. Jdbctemplate update    forum.springsource.org

Nov 19th, 2008, 05:33 PM #1 fmi2 View Profile View Forum Posts Private Message Junior Member Join Date Aug 2007 Posts 8 Jdbctemplate update Hi I am having an issue when ...

20. Inserting Null Values with JdbcTemplate    forum.springsource.org

Anyone has tryed suscessfully to insert nulls values in a table with Spring Jdbc, I mean using JdbcTemplate ??? i'm been woriking on it for a while but hadn't got a ...

21. Reality of JdbcTemplate vs. RdbmsOperation?    forum.springsource.org

I'm reading through "Pro Spring 2.5", and they make a statement to the effect that RdbmsOperation is often more efficient than JdbcTemplate, in the case that the database doesn't recognize repeated ...

22. Problem with jdbcTemplate of superclass    forum.springsource.org

Problem with jdbcTemplate of superclass Hi everybody I'm new to Spring and I'm trying to do some tests with it. My test class extends AbstractTransactionalDataSourceSpringContextTest. The problem is that jdbcTemplate property ...

23. need help on JdbcTemplate.update    forum.springsource.org

need help on JdbcTemplate.update I am working with spring framework. I am using JdbcTemplate.update( PreparedStatementCreator arg0, KeyHolder arg1) method , which takes first argument as PreparedStatementCreator and the other argument is ...

24. A query on JDBCTemplate?    forum.springsource.org

You don't, it will be closed for you, at the end of every jdbcTemplate method or at the end of the transaction if there is one.

25. Null JdbcTemplate & App Context    forum.springsource.org

Null JdbcTemplate & App Context I started using @ContextConfiguration & @RunWith(SpringJUnit4ClassRunner.class), but my JDBC template & application context, which formerly worked fine, are now null when the test method is called. ...

26. JdbcTemplate and SQL n + 1 Selects    forum.springsource.org

I've recently been performing quite a few performance tweaks to database code and decided to do a quick demo for the team. In the spirit of sharing there's a blog post ...

27. PetClinic example vs JdbcTemplate examples    forum.springsource.org

PetClinic example vs JdbcTemplate examples Hi all I was wondering how come the PetClinic example have implementation of update/insert like this: ----------------------- protected class PetInsert extends SqlUpdate { protected PetInsert(DataSource ds) ...

28. JdbcTemplate suppresses exceptions?    forum.springsource.org

Hi- I am using JdbcTemplate to insert a record in my db: Code: this.jdbcTemplate.update("INSERT INTO ratings (article_id, rating) values (?, ?)", new Object[]{articleID, rating}); When the code executes, absolutely nothing happens. ...

29. JdbcTemplate and SQL Joins    forum.springsource.org

JdbcTemplate and SQL Joins I have a simple SELECT that performs a JOIN between two tables - one column on each table. The column value being returned that depends on the ...

30. Problem with JDBCTemplate that should return a cursor    forum.springsource.org

Problem with JDBCTemplate that should return a cursor Hi, I have been tinkering with this code for a while and I could not get it to work. I have a function ...

31. JdbcTemplate: How do I get the current count of open connections?    forum.springsource.org

Hi everybody, I'm using JdbcTemplate in my Spring application, but unfortunately also a direct access to a database connection => DataSourceUtils.getConnection(template.getDataSour ce()) So for my application I need to know how ...

32. JdbcTemplate concurrency issue    forum.springsource.org

JdbcTemplate concurrency issue Hello I seem to have some trouble with using JdbcTemplate. We have extended the JdbcDaoSupport class and we are using transactions. The system receives "messages", which need to ...

33. How to use jdbcTemplate to search from Database?    forum.springsource.org

How to use jdbcTemplate to search from Database? Hi I want to search for some data from data base, but it seems i cannot use regular SQL string with jdbc template. ...

34. Abandoned connection with JdbcTemplate    forum.springsource.org

Abandoned connection with JdbcTemplate Hi, How is it possible that I'm getting the following exception from JdbcTemplate. I thought the template was supposed to take care of properly closing connections: DBCP ...

35. Dynamically set datasource in JdbcTemplate thread safe    forum.springsource.org

Dynamically set datasource in JdbcTemplate thread safe I read many posts in the forum about JdbcTemplate thread safe. Haven't seen any discussion similar to what I am doing. In my DAOImpl ...

36. jdbcTemplate query for object too slow    forum.springsource.org

I'm using the following code in a Spring Batch app. This is taking about 600mS to complete. It is running against a DB2 table on a mainframe. This will execute about ...

37. Help with Spring jdbctemplate error    forum.springsource.org

Help with Spring jdbctemplate error Hi, I am using JDBCTemplate to call a stored procedure in DB2 as below String sql = "call SP_MODIFYDATA(?,?,?,?)"; jdbctemplate.update(sql, new Object[]{ids, dateVal, comments, role}); Three ...

38. SQLIntegrityConstraintViolationException using jdbcTemplate    forum.springsource.org

SQLIntegrityConstraintViolationException using jdbcTemplate Hi, I have a simple DAO that uses org.springframework.jdbc.core.JdbcTemplate. I try to insert a row in a table and child rows in another table. Here is some code ...

39. JDBCTemplate Question    forum.springsource.org

JDBCTemplate Question I have used Spring in the past for multiple things but usually use Hibernate. I haven't looked at the code yet but wanted to ask a few really basic ...

40. JdbcTemplate and jconn2.5.5    forum.springsource.org

Hi, I get the following error: java.lang.AbstractMethodError: com.sybase.jdbc2.jdbc.SybPreparedStatement.getGene ratedKeys() when calling this code: KeyHolder keyHolder = new GeneratedKeyHolder(); PreparedStatementCreatorFactory factory = new PreparedStatementCreatorFactory(sql); PreparedStatementCreator ps = factory.newPreparedStatementCreator(sql, new Object[] {}); template.update(ps, ...

41. JdbcTemplate update help?    forum.springsource.org

JdbcTemplate update help? I'm fairly new at using this framework so any help would be appreciated. I want to use the jdbctemplate.update() to do an sql Update statement. The Update statement ...

42. when does JdbcTemplate commit?    forum.springsource.org

when does JdbcTemplate commit? Hi All, I am just getting in to spring and working on an existing project. We have a dao that extends jdbcdaosupport. We have a method that ...

43. Connection problem while using jdbcTemplate with websphere    forum.springsource.org

Connection problem while using jdbcTemplate with websphere Hi, I am using jdbcTemplate to access database and jndi datasource( websphere). I am getting following error after running application for some time. Could ...

44. unable to get results : prob with jdbctemplate    forum.springsource.org

unable to get results : prob with jdbctemplate Hi guys, can anyone let me know what could be prob with the following String query="select count(*) from CONTROL_QUEUING where jobtype=? and jobcommand=? ...

45. JDBCTemplate Bind Variable Issue    forum.springsource.org

JDBCTemplate Bind Variable Issue Hi, I've been wrestling with an issue for a couple of hours and several searches haven't turned up any answers for me. I'm using JDBCTemplate to query ...

46. large db + jdbctemplate + jboss = out of heap space (too easily)    forum.springsource.org

large db + jdbctemplate + jboss = out of heap space (too easily) hi, i just started bug fixing this java web application that uses: - spring mvc - spring jdbc ...

47. JdbcTemplate Show SQL    forum.springsource.org

Hello guys! I'd like to know if its possible to make JdbcTemplate(with JdbcDaoSupport) show / log the SQL code that is been executed. Thanks.

48. Getting Image by JdbcTemplate    forum.springsource.org

Getting Image by JdbcTemplate Hi all! I've got the following problem : i have image in my db which was stored as byte array, I must get this image from db(postgresql) ...

49. Help with JDBCTemplate and failover    forum.springsource.org

Help with JDBCTemplate and failover Hi, I am using JDBCTemplate to connect to a datasource which has failover between two databases. When one database goes down the other takes the load. ...

50. Spring jdbctemplate isn't working fine ?    forum.springsource.org

Spring jdbctemplate isn't working fine ? Hi everybody. I've got a strange problem using JdbcTemplate. I started from a well-functioning console application, under Spring 2.5.6 but using plain JDBC (connection, statement ...

51. query jdbcTemplate Issue    forum.springsource.org

Hi everybody. I've got a problem using JdbcTemplate with method query. When I insert parameter long with 6 digits i receive exception. I am using the spring 2.0.6 Example: Code: List ...

52. JDBCTemplate    forum.springsource.org

JDBCTemplate Hello all! I am quite a novice regarding jdbctemplate. I need to create a generic method which allows the caller to send an sql-query and get a resultSet in return. ...

53. Spring JdbcTemplate    forum.springsource.org

Hi, This is mohana How to avoid null fields updation using spring jdcTemplate? i.e. I have a object which contains 100 properties, I want to say this object into DB using ...

54. jdbcTemplate and readOnly connection    forum.springsource.org

jdbcTemplate and readOnly connection Hi All, i'd like to use jdbcTemplate as simple framework to access to the db. I don't have big requirements, no transaction at all (autocommit = true) ...

55. IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required    forum.springsource.org

I believe I've properly configured my data source, however, I continually get the following error: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required Below is ...

56. JdbcTemplate + Weblogic DataSource error after redeploy on cluster    forum.springsource.org

Aug 19th, 2010, 04:24 AM #1 Enrico Pizzi View Profile View Forum Posts Private Message Senior Member Join Date Jul 2010 Location Venice, Italy Posts 653 JdbcTemplate + Weblogic DataSource error ...

57. does JdbcTemplate automatically RELEASE datasource connection(s)?    forum.springsource.org

does JdbcTemplate automatically RELEASE datasource connection(s)? From what I've read on using Spring JdbcTemplate for jdbc access in a web application, the template's methods like execute() all automatically and silently take ...

58. JdbcTemplate not updating the database    forum.springsource.org

JdbcTemplate not updating the database Hi, I am not sure why a JdbcTemplate is not updating the database. Everything is fine: *) JdbcTemplate is not null *) int x =jdbcTemplate.update(query, new ...

59. JDBCTemplate gets stuck?    forum.springsource.org

JDBCTemplate gets stuck? hi, I'm developing an application using spring and its JDBCTemplate. My DAO is org.apache.commons.dbcp.BasicDataSource. The database is mysql. When I execute a SELECT- Query, the whole application gets ...

60. Problem using JdbcTemplate for queries in SQL Server 2005    forum.springsource.org

Problem using JdbcTemplate for queries in SQL Server 2005 I use JdbcTemplate's "queryForList" method to execute the stored proc using the string as "exec proc_name". When I used 1.1 driver everything ...

61. JDBCTemplate.setMaxRows() implementation    forum.springsource.org

JDBCTemplate.setMaxRows() implementation How is the method JDBCTemplate.setMaxRows() implemented to restrict the number of rows returned? I am trying to track down a problem I get the exception below. It does not ...

62. JdbcTemplate exception: Network error IOException: Address already in use    forum.springsource.org

JdbcTemplate exception: Network error IOException: Address already in use I am new to Spring framework. I am working on a data migration application. It reads each file in a folder, where ...

63. re: jdbctemplate.query appears to be very slow    forum.springsource.org

re: jdbctemplate.query appears to be very slow Hello, I am in the process of moving my data access layer over to the Spring framework, instead of just making the jdbc calls ...

64. JdbcTemplate call example    forum.springsource.org

I am using oracle for this example 1. Stored procedure (very basic one ) Code: CREATE OR REPLACE procedure procTest(pS OUT NUMBER, pA IN NUMBER, pB IN NUMBER) is begin pS ...

65. Spring JdbcTemplate bulkUpdate Stuck Thread Max Time 600 seconds and weblogic    forum.springsource.org

When doing a batchUpdate using spring Jdbc Template, I am facing some issues and thread gets stuck for more than 600 seconds (weblogic stuck thread time out default value). Can you ...

66. JdbcTemplate.query parameter binding issue    forum.springsource.org

67. JDBCTemplate invalid identifier error because of custom function    forum.springsource.org

We have a large query in the format... Code: SELECT [many fields from joined tables] FROM (SELECT COLUMN_VALUE stdnt_id FROM TABLE(SPLIT('A BUNCH OF STUDENT IDS HERE', ','))) stdnt [many joins here] ...

68. Dynamic Procedure call using JdbcTemplate    forum.springsource.org

Dynamic Procedure call using JdbcTemplate Hi there! Here is my use case. 1. I need to list all the stored procedures (MySQL, I did it quite nicely). 2. Use JdbcTemplate to ...

69. Accessing Timestamp field from SQLite db using JdbcTemplate    forum.springsource.org

Accessing Timestamp field from SQLite db using JdbcTemplate Hi, Can any one help me out in accessing the timestamp field from SQLite db using JdbcTemplate. We are using Postgre & SQLite ...

70. NoSuchMethodError calling org.springframework.jdbc.core.JdbcTemplate.queryFo rObjec    forum.springsource.org

NoSuchMethodError calling org.springframework.jdbc.core.JdbcTemplate.queryFo rObjec Hi, I get a strange error when running java code from eclipse with tomcat server (It is made for debug). Also when I run the same project ...

71. Spring JdbcTemplate equivalent in Seam?    seamframework.org