First of all hi to ervey one!
The problem is this: i have a
So the probklem is that I can't do the query.
It throws an SQLException
org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT * FROM Guitarra WHERE numeroSerie LIKE '?' AND modelo LIKE '?' AND numeroCuerdas LIKE '?' AND nueva LIKE '?' AND color LIKE '?' AND precio LIKE '?' AND fabricante LIKE '?' AND maderaAnterior LIKE '?' AND maderaPosterior LIKE '?' AND tipo LIKE '?']; Parameter index out of range (1 > number of parameters, which is 0).; nested exception is java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:106)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
.
.
.
So how can I use the like expression to do this "SELECT * FROM guitarra WHERE numeroSerie LIKE '%21' AND color LIKE '%' AND numeroCuerdas LIKE '%';" but using in Java in JdbcTemplate??
By the way i'm trying to build a query to search by specific fields I mean, if someone searches a guitar "azul" and 12 cuerdas, this query should work, so what do you recommend me to do??
Greetings and thanks!!
The problem is this: i have a
So the probklem is that I can't do the query.
It throws an SQLException
org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT * FROM Guitarra WHERE numeroSerie LIKE '?' AND modelo LIKE '?' AND numeroCuerdas LIKE '?' AND nueva LIKE '?' AND color LIKE '?' AND precio LIKE '?' AND fabricante LIKE '?' AND maderaAnterior LIKE '?' AND maderaPosterior LIKE '?' AND tipo LIKE '?']; Parameter index out of range (1 > number of parameters, which is 0).; nested exception is java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:106)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
.
.
.
So how can I use the like expression to do this "SELECT * FROM guitarra WHERE numeroSerie LIKE '%21' AND color LIKE '%' AND numeroCuerdas LIKE '%';" but using in Java in JdbcTemplate??
By the way i'm trying to build a query to search by specific fields I mean, if someone searches a guitar "azul" and 12 cuerdas, this query should work, so what do you recommend me to do??
Greetings and thanks!!