How To Provide Database Independency in JDBC Without Using Hibernate.?

后端 未结 3 1330
小鲜肉
小鲜肉 2020-12-06 16:18

I am trying to solve this problem with the help of properties file, but in a Properties file, we can handle only Database Driver problem. If I want to switch my MySQL to Ora

3条回答
  •  抹茶落季
    2020-12-06 16:39

    I don't think so if you switch to hibernate or any orm frameworks. In case of hibernate you can use hql to write the queries in that way you are database independent no matter what database you switch hibernate will take care. You can even look at Spring CrudRepository. I highly doubtful you can achieve database independent queries just with the JDBC. It is good to begin with JDBC for a long run you should consider orm frameworks.

提交回复
热议问题