Hi Eric, Suresh

 

You could also look at some the jdbc tests under the following  for addbatch 
and related examples:

 

https://github.com/apache/incubator-trafodion/tree/master/dcs/src/test/jdbc_test/src/test/java/org/trafodion/jdbc_test

 

Thanks

Arvind

 

 

 

From: Suresh Subbiah [mailto:[email protected]] 
Sent: Friday, January 13, 2017 7:50 PM
To: [email protected]
Subject: Re: jdbc rowset usage?

 

Hi Eric,

 

The steps Selva mentioned are shown in the examples at 
https://examples.javacodegeeks.com/core-java/sql/jdbc-batch-insert-example/

 Section 4. in this example should be relevant. We should have similar examples 
in JDBC tests, but I am not able to find them. 

 

Thanks

Suresh

 

 

On Fri, Jan 13, 2017 at 6:40 PM, Selva Govindarajan 
<[email protected] <mailto:[email protected]> > wrote:

Just prepare the statement with '?' for parameters

Do

 

PreparedStatement.setXXX () for all parameters

PreparedStatement.addBatch()

 

Do the above in a loop, when you reach the required rowset size

 

PreparedStatement.executeBatch().

 

Selva

 


  _____  


From: Eric Owhadi <[email protected] <mailto:[email protected]> >
Sent: Friday, January 13, 2017 3:52 PM
To: [email protected] 
<mailto:[email protected]> 
Subject: jdbc rowset usage? 

 

Hello,

I am struggling to find the jdbc syntax to set an dynamic array parameter:

 

Assuming I prepared this statement s with “Insert into t (a,b,c) values( 
?[1000], ?[1000], ?[1000])”

How do I set each parameter?

 

Assuming a is INT, b is CHAR[10], c is INT?

 

Am I doing something not really supported? Should I use AddBatch instead?

Thanks in advance for the help,
Eric

 

 

 

Reply via email to