I am making a web service in which number of records are coming and they have to be inserted in database faster.
I use PreparedStatement
. Are there any ways to insert records faster?
The data is coming dynamically so, how much data is coming to insert could not be hard-coded. I have a different class which is common for database queries and I am calling it through my 'Servlet'.
Here is the database query code:
public void insertUser_Details(String name,String address) throws Exception {
ps=con.prepareStatement("insert into registration_table(name,address) values(?,?)");
ps.setString(1,name);
ps.setString(2,address);
ps.executeUpdate();
}