pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pprotim <pprotim80@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: Not able to insert array of integers into column of type integer array
Date: Wed, 26 Sep 2012 08:41:03 -0700 (PDT)
Message-ID: <1348674063961-5725537.post@n5.nabble.com> (raw)

Hi,

I am trying to insert a row to a column in a table which is of data type
INT4[]. I am not sure what should be the code in java I should write so that
I can write the insert query. Exception I am getting below:
Help needed!!!!


junit.framework.AssertionFailedError: PreparedStatementCallback; bad SQL
grammar [INSERT INTO ORGANIZATION_STRUCTURE
(ID_ORGANIZATION_STRUCTURE,ID_CLIENT,ORG_LEVEL,AR_ORG_MAP,ID_SUP_LEVEL,ORG_NAME,TIMEZONE_ABREV,ORG_CURRENCY_CODE_ALPHA)
VALUES(NEXTVAL('SEQ_ORGANIZATION_STRUCTURE'),?,?,?,?,?,?,?)]; nested
exception is org.postgresql.util.PSQLException: Can't infer the SQL type to
use for an instance of [Ljava.lang.Integer;. Use setObject() with an
explicit Types value to specify the type to use.
	at junit.framework.Assert.fail(Assert.java:50)
	at
com.ingenico.atlas.integration.eportal.dao.CustomerDAOTest.createOrgStructureTest(CustomerDAOTest.java:59)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
	at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
	at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
	at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Not-able-to-insert-array-of-integers-into-column-of-type-int...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




view thread (4+ messages)  latest in thread

Message-ID: <1348674063961-5725537.post@n5.nabble.com>
Permalink:  ../1348674063961-5725537.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1348674063961-5725537.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pprotim80@yahoo.com
  Subject: Re: Not able to insert array of integers into column of type integer array
  In-Reply-To: <1348674063961-5725537.post@n5.nabble.com>
  References: <1348674063961-5725537.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox