import java.io.*; import javax.xml.parsers.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*; import java.sql.*; public class AineXmlImp{ public static void main(String argumendid[]) throws Exception{ Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("nimistu.xml"); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:baas3", "", ""); Statement st=cn.createStatement(); //teeb uued tabelid baasi1 try { String nlause="CREATE TABLE nimi2 (id_n int, nimi text)"; st.executeUpdate(nlause); String alause="CREATE TABLE aine2 (id_a int, aine text)"; st.executeUpdate(alause); } catch(Exception s) { System.out.println("Baasid olemas: "+s.getMessage()); s.printStackTrace(); } //paneb andmed andmebaasi NodeList nimi=d.getFirstChild().getFirstChild().getChildNodes(); for(int i=0; i