Database « JTextArea « Java Swing Q&A





1. How to connect DB log to a JTextArea ?    coderanch.com

I've looked around and not seen any code that seems to cover this. I've tried to figure it out myself, but just cannot get my head around it. Basically, I have an application where I would like to have the DB log output written to a JTextArea (or other similar component is OK). My first assumption is to use the getLogWriter() ...

2. Aligning record from Database on a textArea    coderanch.com

Can anyone give some direction here, I am retrieving records from Database and append them on the textarea, well they come fine but the problem is with the tabing "\t". I used one tabing for columns and records(columns data) After 3 records under appropraite column fields have been appended, the next comming ones seems to double tab i.e. they leave more ...

3. how to set text in textarea if I don't find something in my database?    coderanch.com

This is how I search for something: private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: if(jComboBox1.getSelectedItem().equals("Cod Carte")) { try { Class.forName("org.apache.derby.jdbc.ClientDriver"); Connection con = (Connection) DriverManager.getConnection("jdbc :mrgreen: erby://localhost:1527/Proiect","aneresia","aneresia"); con.setAutoCommit(false); int rowsUpdated; Statement stmt1 = (Statement) con.createStatement(); ResultSet rs = (ResultSet) stmt1.executeQuery("Select cod_carte,nume_autor,pren_autor,nume_carte," + "nr_car_stoc,editura,an_aparitie,pret_v from CARTI where cod_carte= "+jTextField9.getText()); ResultSetMetaData rsmd = (ResultSetMetaData) rs.getMetaData(); model1.setNumRows(0); model1.setColumnCount(0); for ...