I am using Java to access a MS SQL server. I am looking for a simple way to import data into various tables without having to write large sql querys. Some of these tables have 30 some columns.
I found the apache commons dbutils library and it works really well to read data from tables and map rows to beans. I can't seem to find any code that uses the same principlea to insert data into a table passing the bean as the data values
Is this possible?
Yes, it would be nice, however, I don't think it's possible. One way is to create a static function inside of your POJO class to get the "Insertion SQL statement". Although you must maintain the ordering between the two functions (insertion and parameters).
Employee.java
Then in your SQLManager class, your insert method is as such: