S
S
striver2018-12-23 03:19:24
Java
striver, 2018-12-23 03:19:24

How to copy data from one file to another in Java with different connection settings?

public void asd(Connection connExt, Connection conn, PreparedStatement pst, ResultSet rs
    ) {
        try {
            String sql = "INSERT INTO journal SELECT * FROM journalExt WHERE 1";
            pst = conn.prepareStatement(sql);
            pst.setQueryTimeout(40000);
            pst.execute();
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, e);
        } finally {
            try {
                rs.close();
                pst.close();
            } catch (Exception ex) {
            }
        }
    }

Here is the code that works if you copy the plates as part of setting up the 1st option for connecting to the database. Whether it is possible to create in such request a choice connection for different label. For example, for journal you need to connect via conn, and journalExt - connExt?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question