Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void sprIdNadawcy(){
- try{
- queryString = "select ID, Imie, Nazwisko from Osoby";
- ResultSet rs = db.statement.executeQuery(queryString);
- while (rs.next())
- {
- imie = (String) rs.getObject("Imie");
- nazwisko = (String) rs.getObject("Nazwisko");
- if ((imie + " " + nazwisko).equals(nadawca))
- {
- idNadawcy = (int) rs.getObject("ID");
- System.out.println(idNadawcy);
- }
- }
- } catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- ====================================================================================================================
- public void sprNrWiadomosci(){
- try{
- queryString = "select ID, id_wysylajacego from Wiadomosc ";
- ResultSet rs = db.statement.executeQuery(queryString);
- for (int i = 0; rs.next(); i++)
- { idWiadomosci = rs.getInt("ID");
- tempIdNadawcy = rs.getInt("id_wysylajacego");
- // System.out.println(idWiadomosci + " " + tempIdNadawcy);
- if (tempIdNadawcy == idNadawcy)
- idWiadomosci = this.idWiadomosci;
- }
- }catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- =============================================================================================
- for(int i=0; i<tabelaWiadomosci.getRowCount();i++)
- {
- System.out.println("========OPCJA ZAPISU KOLEJNY WIERSZ========");
- {
- if(tabelaWiadomosci.getValueAt(i, 2) == null)
- tabelaWiadomosci.setValueAt(false, i, 2);
- if(tabelaWiadomosci.getValueAt(i, 2).equals(true))
- {
- System.out.println(tabelaWiadomosci.getValueAt(i, 0));
- nadawca = (String) tabelaWiadomosci.getValueAt(i, 0);
- // sprIdNadawcy();
- // ustawieniePrzeczytania();
- // sprNrWiadomosci();
- }
- else
- if(tabelaWiadomosci.getValueAt(i, 2).equals(false))
- System.out.println("wiersz nr "+i+" jest NIEZAZNACZONY");
- }
- System.out.println("==========================================");
- {
- if (tabelaWiadomosci.getValueAt(i, 3).toString().isEmpty())
- {
- System.out.println("pole tekst jest puste");
- }
- else
- {
- nadawca = (String) tabelaWiadomosci.getValueAt(i, 0);
- sprIdNadawcy();
- sprNrWiadomosci();
- // System.out.println("==============sprawdzam id nadawcy==================");
- // System.out.println(idNadawcy);
- System.out.println(idWiadomosci);
- // System.out.println("=================");
- tekst = (String) tabelaWiadomosci.getValueAt(i, 3);
- System.out.println(tekst);
- System.out.println(nadawca);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement