visittable.getSelectedRow() visittable.getSelectedColumn()
When you select the row, the column get unselected. When you select the column the row gets unselected.
The api says that if a row or a column is not selected, they return -1, as the exception says.
About the insert, try printing the values you are passing and run the query directly to the database and see what happens.