java.sql.SQLException: Could not set parameter at position 3, parameter length is 2

Hot problem!
This exception has a lot of traffic. You can help 18 users by writing a short tip.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by cristianspinetta
, 1 year ago
Could not set parameter at position 3, parameter length is 2
via GitHub by tmcdevitt85
, 1 year ago
Could not set parameter at position 4, parameter length is 3
java.sql.SQLException: Could not set parameter at position 3, parameter length is 2
at org.mariadb.jdbc.internal.util.ExceptionMapper.getSqlException(ExceptionMapper.java:149)
at org.mariadb.jdbc.MariaDbServerPreparedStatement.setParameter(MariaDbServerPreparedStatement.java:151)
at org.mariadb.jdbc.AbstractMariaDbPrepareStatement.setDouble(AbstractMariaDbPrepareStatement.java:1322)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setDouble(DelegatingPreparedStatement.java:129)
at org.apache.commons.dbcp.DelegatingPreparedStatement.setDouble(DelegatingPreparedStatement.java:129)
at scalikejdbc.StatementExecutor.scalikejdbc$StatementExecutor$$bind(StatementExecutor.scala:88)
at scalikejdbc.StatementExecutor$$anonfun$bindParams$2.apply(StatementExecutor.scala:67)
at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733)
at scala.collection.immutable.List.foreach(List.scala:381)
at scalikejdbc.StatementExecutor.bindParams(StatementExecutor.scala:66)
at scalikejdbc.StatementExecutor.initialize(StatementExecutor.scala:50)
at scalikejdbc.StatementExecutor.(StatementExecutor.scala:44)
at scalikejdbc.DBSession$class.createStatementExecutor(DBSession.scala:103)
at scalikejdbc.DBSession$class.updateWithFilters(DBSession.scala:469)
at scalikejdbc.ActiveSession.updateWithFilters(DBSession.scala:706)
at scalikejdbc.DBSession$class.updateAndReturnSpecifiedGeneratedKey(DBSession.scala:564)
at scalikejdbc.ActiveSession.updateAndReturnSpecifiedGeneratedKey(DBSession.scala:706)
at scalikejdbc.SQLUpdateWithGeneratedKey$$anonfun$10.apply(SQL.scala:646)
at scalikejdbc.SQLUpdateWithGeneratedKey$$anonfun$10.apply(SQL.scala:646)
at scalikejdbc.DBConnection$$anonfun$autoCommit$1.apply(DBConnection.scala:221)
at scalikejdbc.DBConnection$$anonfun$autoCommit$1.apply(DBConnection.scala:221)
at scalikejdbc.LoanPattern$class.using(LoanPattern.scala:18)
at scalikejdbc.NamedDB.using(NamedDB.scala:17)
at scalikejdbc.DBConnection$class.autoCommit(DBConnection.scala:221)
at scalikejdbc.NamedDB.autoCommit(NamedDB.scala:17)
at playground.model.GeoNodeRepository$.create(GeoNode.scala:54)
at playground.DBTest$$anonfun$3.apply(DBTest.scala:28)
at playground.DBTest$$anonfun$3.apply(DBTest.scala:27)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.