title: Oracle/Hibernate insert - java.lang.ArrayIndexOutOfBoundsException: 8
body: <p>I am getting exception while inserting records into table.</p>
  
  <blockquote>
    <p>java.lang.ArrayIndexOutOfBoundsException: 8/ org.hibernate.exception.GenericJDBCException: could not prepare statement</p>
  </blockquote>
  
  <p>i used JNDI datasource/Oracle for creating hibernate sessionFactory.</p>
  
  <p>Here is the SessionFactory configuration :</p>
  
  <pre><code>&lt;beans:bean id="jndiDataSource"
      class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;beans:property name="jndiName" value="java:jboss/datasources/TestDS" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:bean id="sessionFactory"
      class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;beans:property name="dataSource" ref="jndiDataSource" /&gt;
      &lt;beans:property name="packagesToScan" value="com.majesco.integration.model" /&gt;
      &lt;beans:property name="configLocation" value="classpath:hibernate.cfg.xml" /&gt;
  &lt;/beans:bean&gt;
  </code></pre>
  
  <p>here hibernate.cfg.xml</p>
  
  <pre><code> &lt;hibernate-configuration&gt;       
      &lt;session-factory&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.Oracle12cDialect&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt; 
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Here model : </p>
  
  <pre><code>   @Entity
  @Table(name="EVENT_AUDIT")
  public class MessageControl implements Serializable {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy=GenerationType.IDENTITY)
      @Column(name="LMESSAGESEQ")
      private Integer messageseq;
  
      @Column(name="NMESSAGEID")
      private Integer messageid;
  
      @Column(name="STRMESSAGE_CD")
      private String messagecd;
  
      @Column(name="STRQUEUE_CD")
      private String queuecd;
  
      @Column(name="NMODULEID_FROM")
      private String moduleidfrom;
  
      @Column(name="NMODULEID_TO")
      private String moduleidto;
  
      @Column(name="NMESSAGE_STATUS")
      private String messagestatus;
  
  
      @Column(name="STRTRXNBR")
      private String transactionNBR;
  
      @Column(name="STRUUID")
      private String uuid;
  
      //getter and setter
  }
  </code></pre>
  
  <p>Here DAO code:</p>
  
  <pre><code>   public class MessageAuditDaoImpl implements AuditDao{
  
      @Autowired
      @Qualifier("sessionFactory")
      private SessionFactory factory;
  
  
      @Override
      public void saveAuditMessage(MessageControl messageControl) {
          try {
              session=factory.openSession();
              session.save(messageControl);
              logger.info("Saved Message");
              session.close();
          } catch (Exception e) {
              logger.error("Exception Occured"+e);
          }   
      }
   }
  </code></pre>
  
  <p>My code is working fine if I insert parameter lower than 8 and getting the exception for parameter grater than 8.</p>
  
  <p>What's the issue or anything i missed in the code?</p>