SQL 1 « Database « Spring Q&A





1. Spring SP Class generation with or without Eclipse    stackoverflow.com

With Hibernate+Eclipse you can generate POJO classes that represent the tables. You can then wire it all together pretty easily with Spring. However, if you have to interact with stored procedures ...

2. Spring.net Drop all adotemplate connections?    stackoverflow.com

I have an application which is connected to a database through a spring.net AdoTemplate. I am charged with creating a restore database method which keeps the app running but drops ...

3. Invalid scale size. Cannot be less than zero    stackoverflow.com

I am using spring-2.5.6 to connect from a standalone application to an Oracle 10g database (ojdbc14.jar) using the org.apache.commons.dbcp.BasicDataSource. When I try to retrieve a SqlRowSet using the public SqlRowSet queryForRowSet(String ...

4. Using Spring's JDBC support to get output parameters    stackoverflow.com

I'm using Spring's JDBC support to run SQL queries and updates on an Oracle database. I'd like to insert a row and then get the key that it was assigned ...

5. Spring - Ingres RDBMS support in sql-error-codes.xml error code mapping file    stackoverflow.com

I have a Java project connecting to an Ingres database and using the Spring Framework. This issue is related to the error codes list configuration. According to Spring Framework API:

...

6. argh - can't get spring to log sql    stackoverflow.com

I'm researching spring for a possible switch to a spring stack. One of the things that I thought was cool was the ability for spring jdbc to log all the ...

7. Spring Jdbc query execution    stackoverflow.com

Does anyone know how what Spring Jdbc template method I could use to execute this 'upsert' or an alternative approach that would also perform the operations in one database call?

UPDATE jasper_report ...

8. How to query for Double with Spring JDBC template query    stackoverflow.com

How do one query for a double with the Spring JDBC temple? For example:

public double getAverageScore() {
    return jdbctemplate.queryFor???("select avg(score) from test");
}
There are queryForInt and queryForLong, but no queryForDouble ...

9. Spring and Mixing SQL and NoSQL db    stackoverflow.com

The answers to my previous post encouraged me mixing SQL and NoSQL db. What is the best practice implementation of two databases in terms of application context configuration and DAO creation? ...





10. Is there a portable way to have "SELECT FIRST 10 * FROM T" semantic?    stackoverflow.com

I want to read data in blocks of say 10k records from a database. I found Result limits on wikipedia and it seems obvious that this can't done with sql ...

11. Is using a JDBC scrolling strategy for paging of tabular data going to result detrimental performance?    stackoverflow.com

We currently have a system that displays a page tabular data on the screen without any paging support in the user interface. It is running on Java 1.5 / Spring ...

12. Requiring parameters in a SQL where clause?    stackoverflow.com

Imagine you have the following table (note: this is a contrived/simplified example):

CREATE TABLE foo (    
  book_id number,
  page number,
  -- [a bunch of other ...

13. Spring JDBC Template Conditional Insert    stackoverflow.com

I am trying to write a conditional batch insert based on Java Parameters, for example

List<Object[]> params = new ArrayList();
params.add(new Object[]{1, 2, 3});

getSimpleJdbcTemplate.batchUpdate(
"INSERT INTO SomeTable( colA, colB, colC)" +
 " VALUES(?, ?, ...

14. massive INSERT - spring framework    stackoverflow.com

I'm doing massive import in SQL Server using my Java application with Spring Framework and SimpleJdbcInsert class. The results are not good and I'm trying to optimize it. I support every ...

15. Configure NHibnerate SQL string cache with Spring.NET    stackoverflow.com

With memory profiling tools, it looks like NHibnerate will cache SQL strings while execution, which occupy a large # of memory spaces. Whether Spring.NET is able to configure the cache-related setting? Thanks.

16. Include sql file to another sql file    stackoverflow.com

Have specific sql file. It may be "connected" to some other more generic .sql init file. Is it possible somehow include reference from one .sql to another .sql file for Oracle? note: DB ...





17. Spring Jasper Integration with Parent and Sub Report using Model beside of SQL Query    stackoverflow.com

I have two domain code:

public class domain1{

private string domain1Name;
private List<domain2> domain2List;

/* getter setter */
}

public class domain2{

private string domain2Name;

/* getter setter */
}
and i have a Spring Controller returning a map then pass ...

18. JOOQ and Spring    stackoverflow.com

Has anyone tried using JOOQ with the Spring framework or am I breaking new ground? http://www.jooq.org

19. Spring JDBC - NamedJdbcParameterTemplate and MapSqlParameterSource with sql types?    stackoverflow.com

Can anybody give me an example of using the Spring JDBC classes NamedParameterJdbcTemplate and MySQLParameterSource using the sql types? The MapSqlParameterSource has this method:

addValue

public MapSqlParameterSource addValue(String paramName,
      ...

20. Dynamically set identity field on/off in nHibernate    stackoverflow.com

I'm new to NHibernate/Spring and I have a query that requires the identity column to be OFF before running the query and turned ON afterwards. Basically, we're reinserting a record into ...

21. Oracle SQL from Java using Spring returns nothing, and doesnt throw exception    stackoverflow.com

I have a Java code that uses Spring to connect and execute sql on an Oracle DB. I have a query that takes long time to execute (20 minutes or ...

22. Spring JDBC Incorrect Syntax on INSERT when query works in SQL Server 2008    stackoverflow.com

I am trying to insert a row into a table using JDBC 2.0 as a Spring dependency. I can run this query inside of SQL Server 2008 without error. But when ...

23. JDBC connection to SQL Server 2005 Instance running on remote machine    stackoverflow.com

Iam trying to connect to sql server 2005 instance running on a remote machine from my spring web application. This web application is running in tomcat server. Earlier When I connected ...

24. Jdbc check type compatiblity    stackoverflow.com

Is there some way to check beforehand if a java type is compatible with a sql.Types? I could type out all the stuff like: if (BIGINT||TINYINT) try BigInteger.parse(myvalue) and if (TIME||DATE||TIMESTAMP) try new ...

25. Keep running a SQL procedure while browsing elsewhere in the application    stackoverflow.com

I am facing a technical issue on a web-app development : Here is the goal : By clicking on a button, the user launches a SQL/Oracle procedure that takes about 5 to 10 ...

26. Spring jdbc templates : What is the best way to keep sql statement out of code    stackoverflow.com

There doesn't seem to be a named query support in Spring JDBC Templates. By named query I mean the facility to reference sql statement by name in java code and keep ...

27. spring-jdbc for IN query having more than 1000 ids    stackoverflow.com

I have a query like this -

SELECT * FROM mytable WHERE id IN()
The IN will get list of ids which are more than 1000. So my query fails on Oracle. One option ...

28. Parameter not being passed in to procedure    stackoverflow.com

I'm having trouble calling procedure in mssql server using java. I keep getting org.springframework.jdbc.BadSqlGrammarException Here is my code:

    public void init(@Qualifier("mssqlDataSource") DataSource dataSource) {
       ...

29. How can I resolve “The cursor was not declaredâ€? from SQL Server    stackoverflow.com

I am connecting to SQL Server via Spring in WebSphere. I have a piece of pretty simple dynamic SQL (below) that is throwing "The cursor was not declared."

SELECT TOP 1
  ...

30. Automatic processes management returning Oracle errors and not running like supposed to    stackoverflow.com

I am trying to decipher a stack trace (partially submitted here). Any help is greatly appreciated! I can understand bits and pieces but not he whole thing. Additionally, ...

31. MS SQL Server named instance connection using Spring JDBC Template    stackoverflow.com

All, I am trying to connect SQL Server named instance using Microsoft JDBC Driver as well as jTds. Both were giving different problems . Microsoft Driver issue : Connection URL :

dataSource.setUrl("jdbc:sqlserver://xx.xx.xx.xx;databaseName=DBNAME;instanceName=SQL2005"); 
instance SQL2005 ...

32. Java Spring Framework    stackoverflow.com

I was wondering what's the error of this code, I get everything right, but why won't it work? here's the code, I got my driver name, and database url right, but ...

33. Log4j Warn No Appenders Error    stackoverflow.com

Possible Duplicate:
How to initialize log4j properly?
I have fix this problems code on the previous Question, but these time, I encountered a new one Again, ...

34. Bunch of Errors after I run my Code    stackoverflow.com

I was trying to add a User in my database using Java with Spring framework(Standalone) but I have encountered problems specifically in this code

package test;
import dao.FinanceDao;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
public class TestDrive {

  ...

35. database reverse engineer MSSQL problem    forum.springsource.org

Hello I created a project with the following roo command: Code: persistence setup --provider HIBERNATE --database MSSQL --databaseName xx --userName xx --password xx database reverse engineer --package ~.domain --schema dbo but ...

36. JodaTime DateTimeFormatter not applied to java.sql.Timestamp    forum.springsource.org

I'm using Spring 3.0.5 and I've noticed that timestamps are not formatted correctly when printed using . The fields are defined as java.util.Date but at runtime they contain a java.sql.Timestamp because ...

37. Loading mass data from database with SQL    forum.springsource.org

Hi, i need to load mass data from the database using SQL. how do u recommend me to approach it ? does spring has some kind of class/utility which can help ...

38. spring-jdbc SqlServer getdate help    forum.springsource.org

this.procGetDate = new SimpleJdbcCall(jdbcTemplate).withFunctionName("getdate"); this.simpleJdbcTemplate.update("update [dbo].[PersonaNatural] set FCExpiracion = ? where IDPersona = ? ", procGetDate.execute(), personaRut.getIdPersona());

39. generating code based on existing sql server database    forum.springsource.org

generating code based on existing sql server database Am evaluating solutions and products that can generate code for maintaining (mostly) lookup type tables in a SQL Server database. The end result ...

40. catch SQL error code=1 via JPASystemException    forum.springsource.org

Hi there! I've created a unique index in one of my table ... and I would like to catch SQL code exception (Error Code 1) ... First of all I could ...

41. Connections to MSSQL not closing when undeploying    forum.springsource.org

Connections to MSSQL not closing when undeploying The problem is that everytime I undeploy my webapp the connection with the MSSQL database is not closed and when I deploy the app ...

42. Executing SQL using a connection    forum.springsource.org

Hi I have a java.sql.Connection that I obtained from JDO (kodo) and want to use it to do plain jdbc stuff. Can I get spring (-dao) to make life easier? I ...

43. Can't create connection with MSSQL    forum.springsource.org

Can't create connection with MSSQL Hi gyes I am using spring roo 1.1.1 and MSSQL(SQL Server 2008 R2) as database i have one small sample with one entity and one field ...

44. compilation of sql and errorcodes lookup slowing me down ?    forum.springsource.org

compilation of sql and errorcodes lookup slowing me down ? Hi, if I put verbose logging on I see the following messages for every sql call to the database : org.springframework.jdbc.object.SqlFunction ...

45. DBRE and MSSQL not generating @NotNull    forum.springsource.org

I tried reverse engineering a SQLServer database using the jTDS JDBC driver and the xml produced from "database introspect" always contains "required="false"" on every column of every table, even though the ...

46. How to show the internal sql that is used to execute with database    forum.springsource.org

How to show the internal sql that is used to execute with database In hibernate we used "showSql" and it shows query like insert into mkyong.stock_transaction (CHANGE, CLOSE, DATE, OPEN, STOCK_ID, ...

47. Reverse engineering MSSQL issue    forum.springsource.org

Reverse engineering MSSQL issue 1. Created top level package 2. Introspect and installed driver 3. updated database.properties with the correct server info 4. ran the reverse engineering from roo shell database ...

48. jdbc problem using MSSQL SERVER 2008    forum.springsource.org

jdbc problem using MSSQL SERVER 2008 Hi, I am successful to access MSSQL 2008 server by regular jsp. But I have a problem to access to MS SQL server 2008 by ...

49. Use of java.sql.Timestamp in field command    forum.springsource.org

Use of java.sql.Timestamp in field command I am new to Roo and most of the rest of Spring. I am learning Roo, and I was trying to create an entity that ...

50. Calling native SQL query for updating    forum.springsource.org

Calling native SQL query for updating I continue using Spring Data JPA more and more. Maybe this question is a little more advanced... I have a stored procedure in my Postgres ...

51. Error in the SQL syntax ?!    forum.springsource.org

May 9th, 2011, 01:53 PM #1 Palsajicoco View Profile View Forum Posts Private Message Junior Member Join Date May 2011 Location Vienna, Austria Posts 9 Error in the SQL syntax ?! ...

54. Bad Sql Grammar exception    forum.springsource.org

bad SQL grammar [insert into T_EMPLOYEE_EMP (MST_ID,MST_TYPE,MST_NAME) values (?,?,?)]; nested exception is java.sql.SQLException: ORA-00904: "MST_NAME": invalid identifier MST_NAME(column name) is alredy there in data base Code: Code: int addEmp = update("insert ...

55. SQl monitoring with org.springframework.jdbc.datasource.DriverManagerD ataSource    forum.springsource.org

Hi, I am using DriverManagerDataSource datasource in my servlet to connect to Oracle. Is it possible to set some property or some other way to show all sql in the System.out ...

56. View actual sql    forum.springsource.org

I am using Spring 3 with hibernate and am running queries against my SQL server database. I'd like to see the actual SQL that was run, not the one that hibernate ...

57. Retrieving sql data in my jsp file?    forum.springsource.org

Retrieving sql data in my jsp file? Hello, i got entities, i got controller and service . is it really not possible to do a sql query (native or hql) with ...

58. BadSqlGrammarException thrown for the wrong reason - SQL Server and Spring JDBC    forum.springsource.org

When I raise an exception in a stored proc (using RAISERROR) it always comes back to my Java code as BadSqlGrammarException, which isn't accurate. Have I missed some configuration? Shouldn't it ...

59. Migration from SQLSERVER to ORACLE fails....    forum.springsource.org

Migration from SQLSERVER to ORACLE fails.... Hi, I have a working solution for Spring batch which consists of couple of jobs that read data from files, web service, database and write ...

60. Error in loading sql-error-codes.xml    forum.springsource.org

Error in loading sql-error-codes.xml I started seeing this warning in my logs...and have no idea why it started happening. I am not loading my own version of this file... Thanks in ...

61. Very slow dynamic SQL    forum.springsource.org

Nov 3rd, 2004, 12:55 PM #1 joegaber View Profile View Forum Posts Private Message Member Join Date Sep 2004 Location North Carolina Posts 38 Very slow dynamic SQL Scenario: I am ...

62. Inserting Date type into SQL server from modelAttribute variable issues    forum.springsource.org

Inserting Date type into SQL server from modelAttribute variable issues Hello folks I am having a hard time dealing with the format Date type variable inside a web portal. The things ...

63. Does Spring Expression Language support IN operator? Similar to SQL IN clause    forum.springsource.org

Does Spring Expression Language support IN operator? Similar to SQL IN clause public class Security { private secTyp1; public Security (String aSecTyp1) { secTyp1 = aSecTyp1; } } I am trying ...

64. getId method not generated from MSSQL    forum.springsource.org

getId method not generated from MSSQL I am trying to generate a simple application using MSSQL with Spring Roo and GWT. I have two basic tables to reverse engineer: Person and ...

65. Reverse Engineer SQL Server error message    forum.springsource.org

Reverse Engineer SQL Server error message Hi, In a new Roo project, using JTDS to access a MS SQL Server Schema and I am receiving a error message. I searched through ...

66. Run sql script on server startup    forum.springsource.org

Run sql script on server startup Hello, I do have some dummy data for testing purposes. What I want now is, that if I start the server, a sql script file ...

67. About the number of SQL requests    forum.springsource.org

About the number of SQL requests Hello all, I'm starting to learn Spring and Hibernate and I'm also starting to use SpringRoo. I have (for example) a company table CPY that ...

68. CustomEditor for java.sql.Date ?    forum.springsource.org

CustomEditor for java.sql.Date ? I have a JSP that binds to a data bean. In that data bean, I have a java.util.Date attribute and a java.sql.Date attribute. My initBinder is as ...

69. UncategorizedSQLException with SQL Partitioning - Parallel Processing    forum.springsource.org

UncategorizedSQLException with SQL Partitioning - Parallel Processing Hi, I run a job with SQL Partitioning. I encountered the following error during execution: org.springframework.jdbc.UncategorizedSQLException : Executing query; uncategorized SQLException for SQL [SELECT ...

70. binding to java.sql.Timestamp (custom editor)    forum.springsource.org

binding to java.sql.Timestamp (custom editor) Hello, I've searched the forum and cannot find a satisfactory answer. I have an abstractCommandController with validator and command object. The comman object holds to fields ...

71. Best practice for direct SQL with hiberate/spring    forum.springsource.org

Best practice for direct SQL with hiberate/spring Hi, we are using Hibernate together with Spring 1.1. Our Beans are configured with the TransactionProxyFactoryBean. For performance reasons we have to use direct ...

72. SQL error using the default MessageStore impl    forum.springsource.org

Nov 28th, 2011, 10:19 AM #1 dr4w View Profile View Forum Posts Private Message Junior Member Join Date Dec 2010 Posts 5 SQL error using the default MessageStore impl Hi All ...

73. petclinic sql select statements having 2 or more variables    forum.springsource.org

petclinic sql select statements having 2 or more variables A real newbie here. From the petclinic example how does one use two (not only one) variables in the where clause of ...

74. Problem using Native SQL    forum.springsource.org

Problem using Native SQL Hi, could someone please help with the following, which is making use of native SQL. The trouble is that following line of code is not being accepted ...

75. Whether spring has a SQLServer MaxValueIncrementer?    forum.springsource.org

hi,all I know spring have already contain some database's id auto incrementer for example MySQLMaxValueIncrementer,OracleSequenceMaxValueInc rementer,but it doesn't have a SQLServer and Sybase's implementation. Anybody can tell me how can i ...

76. SQL error codes for Adaptive Server Enterprise    forum.springsource.org

Hi, We are getting the following message. INFO SQLErrorCodesFactory - SQL error codes for 'Adaptive Server Enterprise' not found Could someone help in explaining how we would configure the error codes ...

77. Spring JDBC & dynamic sql    forum.springsource.org

Hi, just wated find out what would be the best way to use spring jdbc classes for dynamic searches. The sql is not known at the program's start, the number of ...

78. Exception output vague from mapping query due to bad sql.    forum.springsource.org

Exception output vague from mapping query due to bad sql. Just a fyi. I accidentily wrote " severity,..... from ....." whereas I should have written "select severity, .... from ....". The ...

79. Hypersonic SQL DB    forum.springsource.org

What exactly do you want to know? Release 0.8.1 for example uses Hypersonic internally for its sample application and unit tests. Perhaps take a look there.

80. JSTL/SQL and Spring's datasource    forum.springsource.org

Hello, I want to use the sql-Tag (JSTL) and wonder how I could use the datasource, which is instantiated by Spring as usual (org.springframework.jdbc.datasource.DriverManager DataSource bean). How do I get JSTL ...

81. SQLServer insert problem    forum.springsource.org

Apr 1st, 2005, 03:57 AM #1 lucia.baldelli View Profile View Forum Posts Private Message Junior Member Join Date Apr 2005 Posts 2 SQLServer insert problem Hello everybody! I'm trying to migrate ...

82. how to pass NULL as an IN parameter to SQL function    forum.springsource.org

how to pass NULL as an IN parameter to SQL function I have an SQL Server 2000 function, that has 1 out parameter and 3 in parameters. The 3rd parameter is ...

83. baffling sql error - please help!    forum.springsource.org

baffling sql error - please help! Hi, I am getting this exception: [PreparedStatementCreatorFactory.PreparedStatementC reatorImpl: sql=[select messageID, fromUserName, subject, dateSent, isRead from messages where toUserName = ? and visibleToRecipient = 1 order ...

84. missing quotes in generated SQL around string literal, help!    forum.springsource.org

missing quotes in generated SQL around string literal, help! Hi I am a beginner of spring/hibernate (3.0) and postgres (8.0.3), and I ran into a strange problem. I am just trying ...

85. What is the correct way to set up an SQL IN clause?    forum.springsource.org

What is the correct way to set up an SQL IN clause? What is the correct way to set up an SQL IN clause? It works when I pass in a ...

86. What is the correct way to set up an SQL IN clause?    forum.springsource.org

What is the correct way to set up an SQL IN clause? What is the correct way to set up an SQL IN clause? It works when I pass in a ...

87. Cannot bind java.sql.date in CustomDateEditor    forum.springsource.org

Cannot bind java.sql.date in CustomDateEditor I would like to bind a date field which is in the format of 2005-07-04 to the java.sql.Date format, so I register using these Code: protected ...

88. ms sqlserver JDBC driver supports batching?    forum.springsource.org

ms sqlserver JDBC driver supports batching? I use spring jdbc and ms sqlserver JDBC driver,but I encounter a error org.springframework.jdbc.BadSqlGrammarException: Bad SQL grammar [update Bookreview set F_IsAvaliable = 0 where F_reviewID ...

89. usersByUsernameQuery SQL statement problem    forum.springsource.org

usersByUsernameQuery SQL statement problem Hi guys, My user table contain a field call 'activate_date' where if this field is null, user won't be able to login. I configured the applicationContext-security.xml like ...

90. Print SQL statements    forum.springsource.org

hi all, I'm using the ibatis sqlmap with the spring framework and wanted to know how I can print out my sqlmap SQL statements for debugging purposes? I want to see ...

91. Issuing plain sql queries    forum.springsource.org

Hi! How do I issue plain SQL queries (non-hibernate) but still within a transaction? Using: Connection con = session.connection(); // do some sql query using thecon object // if it fails, ...

92. recovering from SQL connection loses...    forum.springsource.org

recovering from SQL connection loses... I'm deploying an application using Spring and Hibernate 3.0.5 to a WebLogic 8.1 SP4 server. Things are working fine *UNLESS* the database connection goes down. Then ...

93. is there mssql server database scripts for jpetstore?    forum.springsource.org

I download the springframework 1.2.3 and installed the jpetstore for hsqldb database successfully, when I try to change the datasource, i only found the database scripts for mysql, hsqldb, oracle and ...

94. XML SQL Interface for databases    forum.springsource.org

Does spring have anything that publishes information within a database as XML? There are quite a few resources out there, but I was wondering if Spring has something. Couple of good ...

95. Custom editor for java.sql.Date ?    forum.springsource.org

Custom editor for java.sql.Date ? I would like to bind a date field which is in the format of 2005-09-29 to the java.sql.Date format, so i tried to register a custom ...

96. SQL Exeception while trying to login    forum.springsource.org

SQL Exeception while trying to login Hi, I am trying to authenticate against table like this: Code: SELECT username, ...

97. sql-error-codes.xml or transition to 1.2.3 or 1.2.5    forum.springsource.org

Nov 10th, 2005, 11:57 AM #1 serge View Profile View Forum Posts Private Message Junior Member Join Date Feb 2005 Location Harvard, Massachusetts Posts 8 sql-error-codes.xml or transition to 1.2.3 or ...

98. Sql Server 2000 vs Oracle 9i - performance problem    forum.springsource.org

Sql Server 2000 vs Oracle 9i - performance problem Hi everyone, I would like to direct my question especially to people having experience with Hibernate and Spring frameworks. Short problem description: ...

99. Bad Sql Grammar Exception    forum.springsource.org

Bad Sql Grammar Exception Hi All , I have duplicated the JdbcDaoImpl ,DaoAuthenticationProvider , AuthenticationDao so that my userByUsernameQuery takes two parameters to retrieve the uname/Pword . Since i dont need ...

100. Sql Server 2000 error pool connection    forum.springsource.org

you didn't tell much details but in generell: Do not use Microsofts jdbc driver, try "jtds" instead, really the better solution. i run a sql-server 2000 and connection pooling, no trouble ...