vendredi 4 septembre 2020

Put data from sql table in java fields

I have a JDBC DB with multiple tables. What I want to do is the next thing. I want to create a pattern for getting the content of a table. I have done the connection to the DB and I have a form where I insert the name of the table. After that, I have a query that selects all from that table and after I go with an for and call method "getColumnType(i);" What I want to do is to create a hardcoded method that takes the column type, for example, he got value 4 what that means is an Integer, and with a switch to take that column content and put into an int field, and so on for all data types. This program is created using Java Web Dynamic Application, some advice for how to do that pls?




Aucun commentaire:

Enregistrer un commentaire