Design: Abstract JDBC and Data Source for SQL / DefaultTableModel

My callbacks for a dynamic data source and topology, as well as my front-end calls for a bunch of applications that request RDBMS. My idea is to get away from the JDBC API as a whole, as it turns out, for any API that the application binds to.

Here is the design idea ... Upon request, the application code passes in SQL and gets the result DefaultTableModel. When updating, the application code passes in SQL (even its batches) and as a result receives a success / failure code (plus an error message).

Do you combine all your application code with the DefaultTableModel class? Will there be a better class for general handling of untied requests? (If I ever need metadata, I can subclass / encapsulate it with the result). Are there any examples of this already done? For this application, I do not need more than the above. I have no extravagant needs for an RDBMS.

What standard parameters other than JDBC does the Java API have for storing data in a ResultSet? I am familiar with AbstractTableModel and DefaultTableModel. In any case, it should be smart enough to associate a class with each column in terms of data type.

+4
source share

No one has answered this question yet.

Source: https://habr.com/ru/post/1624680/


All Articles