アプリケーション全体を再度開かずに、新しい行を挿入した後にデータベースを更新する方法を知りたいです。アプリケーションの次のステップで新しいデータを表示できるようにしたいと考えています。解決策が見つからないので、例を投稿していただければ幸いです。もちろん可能であれば。これが私の接続方法です
    try{
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    Class.forName(driver);
    String db = "jdbc:odbc:FlowValves";
    con = DriverManager.getConnection(db);
    st = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
    }catch(Exception ex){
        ex.printStackTrace();
    }
これが私の挿入方法の1つです。
    String sql = "select * from Typy";
    try{
        ResultSet result;
        result = st.executeQuery(sql);
        result.moveToInsertRow();
        String stringNazwa = (String)nazwaZaworuField.getText();
        result.updateString("Typ", stringNazwa);
        String stringDN = (String)dnZaworuField.getText();
        result.updateString("DN", stringDN);
        String stringPN = (String)pnZaworuField.getText();
        result.updateString("PN", stringPN);
        String stringIndeks = (String)indeksField.getText();
        result.updateString("Indeks", stringIndeks);
        result.insertRow();
        result.close();
        JOptionPane.showMessageDialog(null, "Wprowadzono dane", "Komunikat", JOptionPane.INFORMATION_MESSAGE);
    }catch(Exception ex){
        ex.printStackTrace();
    }