Mapping a row from a SQL data to a Java object

前端 未结 9 1296
悲哀的现实
悲哀的现实 2021-02-06 02:34

I have a Java class with instance fields (and matching setter methods) that match the column names of a SQL database table. I would like to elegantly fetch a row from the table

9条回答
  •  星月不相逢
    2021-02-06 03:11

    If you use JDBC that is how it works. If you want to avoid adding columns like this in Java, you may consider using some ORM frameworks.

提交回复
热议问题