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 Abimp{ public static void main(String argumendid[]) throws Exception{ Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("aadressikogu.xml"); try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection cn=DriverManager.getConnection("jdbc:odbc:baas1", "", ""); Statement st=cn.createStatement(); //teeb uued tabelid baasi1 try { String alause="CREATE TABLE aadress2 (id_a int, aadress text)"; st.executeUpdate(alause); String mlause="CREATE TABLE marksonad2 (id_m int, marksona text)"; st.executeUpdate(mlause); String ylause="CREATE TABLE yhend2 (id_y int, id_m int, id_a int)"; st.executeUpdate(ylause); } catch(Exception s) { System.out.println("Baasid olemas: "+s.getMessage()); s.printStackTrace(); } //paneb andmed andmebaasi NodeList aadressid=d.getFirstChild().getFirstChild().getChildNodes(); for(int i=0; i