How to insert an array in a loop to the database

前端 未结 3 1859
小蘑菇
小蘑菇 2021-01-25 03:10

I want to insert a set of arrays into a database(HANA) in a loop.My code is below:

public class jdemo {
   public static void main(String[] args) {
      Connect         


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-25 03:55

    You are using createStatement instead of prepareStatement. createStatement does nut support parameters!

    Check https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html

    And https://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html

    for details Hope this helps

    Would be nice if you provide DDL, error messages etc. next time, then its easier to analyze.

提交回复
热议问题