title: java.sql.SQLException: invalid arguments in call
body: <p>I am learning to integrate hibernate with spring to connect to Oracle 11g using the below code. But stuck with the same error from few days. Please help me resolve this. i have tried the different solutions mentioned in other answers given for questions with the same error, but no luck.</p>
  
  <p>Any relevant solutions welcome.</p>
  
  <p>Thanks,</p>
  
  <p>Nisha</p>
  
  <p><strong>spring.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"&gt;
  
      &lt;bean id="serverDatasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt; 
          &lt;property name="driverClassName" &gt;
              &lt;value&gt;oracle.jdbc.driver.OracleDriver&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="url" &gt;
              &lt;value&gt;jdbc:oracle:thin:@10.23.225.22:1521:PRACTICE&lt;/value&gt;
          &lt;/property&gt;
          &lt;!--  &lt;property name="username" value="SCOTT"/&gt;
          &lt;property name="password" value="tiger"/&gt;--&gt;
      &lt;/bean&gt; 
  
      &lt;bean id="dataSource" class="org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter"&gt;
          &lt;property name="targetDataSource" ref="serverDatasource"/&gt;
          &lt;property name="username"&gt;&lt;value&gt;SCOTT&lt;/value&gt;&lt;/property&gt;
          &lt;property name="password"&gt;&lt;value&gt;tiger&lt;/value&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
  
      &lt;!-- Hibernate 5 SessionFactory bean definition --&gt;
      &lt;bean id="Hibernate5SessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;com.springHibernate.model.Person&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="HibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle9Dialect&lt;/prop&gt;
                  &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="personDao" class="com.springHibernate.dao.PersonDaoImpl"&gt;
          &lt;property name="sessionFactory" ref="Hibernate5SessionFactory"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;  
  </code></pre>
  
  <p><strong>Main Method: SpringHibernateMain</strong> </p>
  
  <pre><code>     package com.springHibernate.main;
  
          import java.util.List;
          import org.springframework.context.support.ClassPathXmlApplicationContext;
          import com.springHibernate.dao.PersonDao;
          import com.springHibernate.model.Person;
  
          public class SpringHibernateMain {
  
              public static void main(String[] args) {
  
                  ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
  
                  PersonDao personDao = context.getBean(PersonDao.class);
  
                  Person p = new Person();
  
                  p.setId(1);
                  p.setName("John");
                  p.setCountry("United States");
  
                  personDao.save(p);
  
                  List&lt;Person&gt; person = personDao.listPerson();
  
                  for(Person p1 : person){
                      System.out.println("Person List:" + p1);
                  }
  
              }
  
          }
  </code></pre>
  
  <p><strong>Stack Trace:</strong></p>
  
  <pre><code>ERROR: Unable obtain JDBC Connection
  java.sql.SQLException: invalid arguments in call
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
      at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:414)
      at oracle.jdbc.driver.T4CConnection.&lt;init&gt;(T4CConnection.java:165)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:130)
      at org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter.doGetConnection(UserCredentialsDataSourceAdapter.java:162)
      at org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter.getConnection(UserCredentialsDataSourceAdapter.java:145)
      at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
      at org.hibernate.internal.SessionFactoryImpl$3.obtainConnection(SessionFactoryImpl.java:643)
      at org.hibernate.hql.spi.id.IdTableHelper.executeIdTableCreationStatements(IdTableHelper.java:67)
      at org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy.finishPreparation(GlobalTemporaryTableBulkIdStrategy.java:125)
      at org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy.finishPreparation(GlobalTemporaryTableBulkIdStrategy.java:42)
      at org.hibernate.hql.spi.id.AbstractMultiTableBulkIdStrategyImpl.prepare(AbstractMultiTableBulkIdStrategyImpl.java:88)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:451)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:465)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:416)
      at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:401)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:753)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at com.springHibernate.main.SpringHibernateMain.main(SpringHibernateMain.java:14)
  
  May 16, 2016 12:59:16 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
  WARN: SQL Error: 17433, SQLState: null
  May 16, 2016 12:59:16 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
  ERROR: invalid arguments in call
  Exception in thread "main" org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:87)
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:109)
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:227)
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:234)
      at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:214)
      at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:52)
      at org.hibernate.internal.SessionImpl.beginTransaction(SessionImpl.java:1525)
      at com.springHibernate.dao.PersonDaoImpl.save(PersonDaoImpl.java:25)
      at com.springHibernate.main.SpringHibernateMain.main(SpringHibernateMain.java:24)
  Caused by: java.sql.SQLException: invalid arguments in call
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
      at oracle.jdbc.driver.PhysicalConnection.&lt;init&gt;(PhysicalConnection.java:414)
      at oracle.jdbc.driver.T4CConnection.&lt;init&gt;(T4CConnection.java:165)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
      at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:155)
      at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:130)
      at org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter.doGetConnection(UserCredentialsDataSourceAdapter.java:162)
      at org.springframework.jdbc.datasource.UserCredentialsDataSourceAdapter.getConnection(UserCredentialsDataSourceAdapter.java:145)
      at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
      at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:386)
      at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:84)
      ... 8 more
  </code></pre>