Server Technology PPNT Instrukcja Użytkownika Strona 74

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 95
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 73
Java Servlets: XML Manipulation(1/2)
Java SE 1.4+ includes library for manipulating XML data
Element root = documen t.cr eate Elem ent( "Cou rse" );
document.appendChild(root);
...
Connection connection = DriverManager.getConnection(...);
Statement statement = connection.createStatement();
ResultSet result = sta teme nt.e xecu teQu ery( "SEL ECT * FROM " + dbms_db_table_);
while(result.next()){
String name = result.g etSt ring ("na me") ;
Element el_name = docu ment .cre ateE leme nt(" name ");
Text na me_ text = document.crea teTe xtNo de(n ame) ;
el_name.appendChild(name_text);
student.appendChild(el_name);
}
(74/95)
Przeglądanie stron 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 94 95

Komentarze do niniejszej Instrukcji

Brak uwag