I'am currently newbie at java, and I've been searching for a effective way to put database informations to jtable and I heard about rs2xml. I really want to learn this because other methods makes me confuse and gives me headache.
Does anyone know how to use it effectively ? And if you don't mind can you explain with a simple code.
Thanks in advance.
The rs2xml jar is used to display the data in a table format. So, once you create a project in Eclipse IDE, you have to import the rs2xml jar and JDBC connector JAR into the project.
rs2xml is a jar library that can be used to make the result set of a query an input for the table model is pretty useful @camickr. – Mohammed Housseyn Taleb.
import net.proteanit.sql.DbUtils;
try {
st = conn.createStatement();
st.executeQuery(q);
ResultSet rs = st.executeQuery(q);
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch (SQLException ex) {
JOptionPane.showMessageDialog(null, ex);
} finally {
try {
rs.close();
} catch (SQLException e) { /* ignore */
}
try {
st.close();
} catch (SQLException e) { /* ignore */
}
}
that a sample of use video tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With