2021年5月2日星期日

how to create table for array list of products using JDBC?

i am newbie to sql and JDBC. I am trying to write a method like this for my assignment which creates a table for the products. public List<Integer> create(List<P1> p1)product has id, name and bunch of other attributes. I am not sure if I should declare a table called Integer in the sql file, since i don't know how to write the query for this one but I think maybe it will be like thisINSERT INTO integer (product) VALUES(:product)? normally i would write the query for insertion like this INSERT INTO product (id, name,...etc) VALUES(?,?,?,?...etc)" but the List<Integer> is confusing me. Could someone please explain whats happening here and how I should implement the method?

https://stackoverflow.com/questions/67362430/how-to-create-table-for-array-list-of-products-using-jdbc May 03, 2021 at 09:04AM

没有评论:

发表评论