亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? savaipinfo.java~2~

?? 這是一個(gè)通過java 編程的學(xué)生信息管理系統(tǒng)和學(xué)籍管理系統(tǒng)
?? JAVA~2~
字號(hào):
package tsinghuaip;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.PreparedStatement;
import org.w3c.dom.Document;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Pricing extends Object {

   public static void main (String args[]){

       //Create the Document object
      Document mapDoc = null;
      //Define a new Document object
      Document dataDoc = null;
      //Create the new Document
      Document newDoc = null;
      try {
         //Create the DocumentBuilderFactory
         DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
         //Create the DocumentBuilder
         DocumentBuilder docbuilder = dbfactory.newDocumentBuilder();
         //Parse the file to create the Document
         mapDoc = docbuilder.parse("mapping.xml");
         //Instantiate a new Document object
         dataDoc = docbuilder.newDocument();

         //Instantiate the new Document
         newDoc = docbuilder.newDocument();
      } catch (Exception e) {
         System.out.println("Problem creating document: "+e.getMessage());
      }

      //Retrieve the root element
      Element mapRoot = mapDoc.getDocumentElement();
      //Retrieve the (only) data element and cast it to Element
      Node dataNode = mapRoot.getElementsByTagName("data").item(0);
      Element dataElement = (Element)dataNode;
      //Retrieve the sql statement
      String sql = dataElement.getAttribute("sql");

      //Output the SQL statement
      System.out.println(sql);

      //For the JDBC-ODBC bridge, use
      //driverName = "sun.jdbc.odbc.JdbcOdbcDriver"
      //and
      //connectURL = "jdbc:odbc:pricing"
      String driverName = "JData2_0.sql.$Driver";
      String connectURL = "jdbc:JDataConnect://127.0.0.1/pricing";
      Connection db = null;
      //Create the ResultSetMetaData object, which will hold information about
      //the ResultSet
      ResultSetMetaData resultmetadata = null;

      //Create a new element called "data"
      Element dataRoot = dataDoc.createElement("data");

      try {
         Class.forName(driverName);
         db = DriverManager.getConnection(connectURL);
      } catch (ClassNotFoundException e) {
         System.out.println("Error creating class: "+e.getMessage());
      } catch (SQLException e) {
         System.out.println("Error creating connection: "+e.getMessage());
      }

      //Create the Statement object, used to execute the SQL statement
      PreparedStatement statement = null;
      //Create the ResultSet object, which ultimately holds the data retreived
      ResultSet resultset = null;
      try {
         statement = db.prepareStatement("select * from products");
         //Execute the query to populate the ResultSet
         resultset = statement.executeQuery();

         //Get the ResultSet information
         resultmetadata = resultset.getMetaData();
         //Determine the number of columns in the ResultSet
         int numCols = resultmetadata.getColumnCount();

         //Check for data by moving the cursor to the first record (if there is one)
         while (resultset.next()) {
            //For each row of data
            //Create a new element called "row"
            Element rowEl = dataDoc.createElement("row");
            for (int i=1; i <= numCols; i++) {
               //For each column index, determine the column name
               String colName = resultmetadata.getColumnName(i);
               //Get the column value
               String colVal = resultset.getString(i);
               //Determine if the last column accessed was null
               if (resultset.wasNull()) {
                  colVal = "and up";
               }
               //Create a new element with the same name as the column
               Element dataEl = dataDoc.createElement(colName);
               //Add the data to the new element
               dataEl.appendChild(dataDoc.createTextNode(colVal));
               //Add the new element to the row
               rowEl.appendChild(dataEl);
            }
            //Add the row to the root element
            dataRoot.appendChild(rowEl);

         }
      } catch (SQLException e) {
         System.out.println("SQL Error: "+e.getMessage());
      } finally {
         System.out.println("Closing connections...");
         try {
            db.close();
         } catch (SQLException e) {
            System.out.println("Can't close connection.");
         }
      }
      //Add the root element to the document
      dataDoc.appendChild(dataRoot);
      //Retrieve the root element (also called "root")
      Element newRootInfo = (Element)mapRoot.getElementsByTagName("root").item(0);
      //Retrieve the root and row information
      String newRootName = newRootInfo.getAttribute("name");
      String newRowName = newRootInfo.getAttribute("rowName");
      //Retrieve information on elements to be built in the new document
      NodeList newNodesMap = mapRoot.getElementsByTagName("element");

      //Create the final root element with the name from the mapping file
      Element newRootElement = newDoc.createElement(newRootName);

      //Retrieve all rows in the old document
      NodeList oldRows = dataRoot.getElementsByTagName("row");
      for (int i=0; i < oldRows.getLength(); i++){

         //Retrieve each row in turn
         Element thisRow = (Element)oldRows.item(i);

         //Create the new row
         Element newRow = newDoc.createElement(newRowName);

         for (int j=0; j < newNodesMap.getLength(); j++) {

            //For each node in the new mapping, retrieve the information
            //First the new information...
            Element thisElement = (Element)newNodesMap.item(j);
            String newElementName = thisElement.getAttribute("name");

            //Then the old information
            Element oldElement = (Element)thisElement.getElementsByTagName("content").item(0);
            String oldField = oldElement.getFirstChild().getNodeValue();


            //Get the original values based on the mapping information
            Element oldValueElement = (Element)thisRow.getElementsByTagName(oldField).item(0);
            String oldValue = oldValueElement.getFirstChild().getNodeValue();

            //Create the new element
            Element newElement = newDoc.createElement(newElementName);
            newElement.appendChild(newDoc.createTextNode(oldValue));

            //Retrieve list of new elements
            NodeList newAttributes = thisElement.getElementsByTagName("attribute");
            for (int k=0; k < newAttributes.getLength(); k++) {
               //For each new attribute
               //Get the mapping information
               Element thisAttribute = (Element)newAttributes.item(k);
               String oldAttributeField = thisAttribute.getFirstChild().getNodeValue();
               String newAttributeName = thisAttribute.getAttribute("name");

               //Get the original value
               oldValueElement = (Element)thisRow.getElementsByTagName(oldAttributeField).item(0);
               String oldAttributeValue = oldValueElement.getFirstChild().getNodeValue();

               //Create the new attribute
               newElement.setAttribute(newAttributeName, oldAttributeValue);
            }

            //Add the new element to the new row
            newRow.appendChild(newElement);

         }
         //Add the new row to the root
         newRootElement.appendChild(newRow);
      }
      //Add the new root to the document
      newDoc.appendChild(newRootElement);

      System.out.println(newRootElement.toString());
   }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线不卡一区| 亚洲黄色小视频| 久久久精品综合| 久久99国产精品成人| 亚洲精品一区二区三区精华液| 蜜臀精品久久久久久蜜臀| 日韩欧美一区电影| 国产成人精品网址| 亚洲人精品一区| 精品视频999| 久久精品国产久精国产爱| 国产一区不卡视频| 粉嫩嫩av羞羞动漫久久久 | 91玉足脚交白嫩脚丫在线播放| 人人精品人人爱| 蜜臀av一区二区三区| 激情综合网激情| 成人精品高清在线| 91国产免费看| 久久网这里都是精品| 亚洲香肠在线观看| 91视视频在线直接观看在线看网页在线看 | 日本伊人色综合网| 国产一区在线不卡| 在线精品视频一区二区三四 | 欧美制服丝袜第一页| 在线视频国内自拍亚洲视频| 国产网站一区二区| 另类欧美日韩国产在线| 欧美在线观看视频一区二区三区 | 精品国产乱码91久久久久久网站| 久久99国产精品麻豆| www.欧美色图| 欧美丰满少妇xxxbbb| 国产一区二区三区蝌蚪| 亚洲综合成人网| 久久精品在线观看| 91久久免费观看| 国产精品一区二区久久不卡| 中文字幕av资源一区| 欧美一区二区三区免费观看视频| 亚洲一区二区三区四区五区中文| 欧美成人国产一区二区| 99精品欧美一区二区蜜桃免费| 日本成人超碰在线观看| 亚洲免费观看高清在线观看| 欧美精品一区二区三区高清aⅴ | 国产福利精品导航| 久久亚洲一级片| 亚洲情趣在线观看| 99精品桃花视频在线观看| 精品人伦一区二区色婷婷| www.性欧美| 亚洲精品一卡二卡| 一区二区三区免费观看| 国产成人av电影| 免费美女久久99| 亚洲国产精品精华液网站| 亚洲欧美激情在线| 中文字幕综合网| ...xxx性欧美| 国产精品丝袜91| 欧美性三三影院| 精品夜夜嗨av一区二区三区| 精品国产人成亚洲区| 免费看欧美女人艹b| 亚洲免费av网站| 欧美色图在线观看| 成人一级片在线观看| 一区二区三区视频在线看| 国产精品久久久久毛片软件| 2020日本不卡一区二区视频| 欧美成人精品高清在线播放| 欧美一区二区三区四区高清| 欧美日韩一二三区| 欧美亚洲国产怡红院影院| 91麻豆国产精品久久| 成人激情小说网站| 99国内精品久久| 91视频观看视频| 色综合激情五月| 国产亚洲欧美激情| 秋霞午夜鲁丝一区二区老狼| 久久综合久久综合久久综合| 精品福利av导航| 国产日韩一级二级三级| 中文字幕高清一区| 亚洲色图视频免费播放| 一区二区三区蜜桃| 亚洲成人先锋电影| 首页国产丝袜综合| 精品亚洲免费视频| 成人精品国产一区二区4080| 99热在这里有精品免费| 欧美视频在线播放| 欧美电影免费观看完整版| 久久蜜桃av一区二区天堂| 亚洲国产精品精华液ab| 亚洲三级久久久| 婷婷丁香激情综合| 国产一区二三区好的| av成人老司机| 欧美福利一区二区| 久久久久久久久免费| 中文字幕亚洲区| 五月开心婷婷久久| 国产乱码精品一区二区三区五月婷| 成人h动漫精品| 欧美日韩一区二区三区在线看| 欧美日韩国产天堂| 久久婷婷久久一区二区三区| 亚洲天天做日日做天天谢日日欢| 天天综合色天天| 国产成人免费视| 欧美日韩国产影片| 欧美国产1区2区| 日韩一区精品字幕| 成人三级在线视频| 91精品欧美久久久久久动漫| 国产女人18毛片水真多成人如厕 | 亚洲视频电影在线| 免费成人在线观看视频| 不卡的av电影| 日韩欧美一二三区| 亚洲乱码日产精品bd| 韩日欧美一区二区三区| 欧美亚洲高清一区| 国产日产欧产精品推荐色 | 蜜臀av一级做a爰片久久| 懂色av一区二区在线播放| 在线不卡免费av| 亚洲欧美日韩国产中文在线| 欧美日韩亚洲综合一区| 国产日韩欧美电影| 国产在线不卡一区| 夜夜揉揉日日人人青青一国产精品| 亚洲一区二区三区视频在线播放 | 久久精品国产精品亚洲精品| 大陆成人av片| 欧美成人性福生活免费看| 亚洲视频免费看| 国产成人精品三级麻豆| 久久久久国产一区二区三区四区| 日本在线不卡一区| 欧美va日韩va| 亚洲欧美国产三级| 国产风韵犹存在线视精品| 日韩一区和二区| 亚洲一区二区欧美激情| 99国内精品久久| 中文字幕第一区| 国产乱人伦偷精品视频不卡| 欧美一区二区三区在线视频| 亚洲国产美国国产综合一区二区| 99精品国产热久久91蜜凸| 国产精品美日韩| 国产福利91精品| 日本一区二区不卡视频| 懂色av噜噜一区二区三区av| 欧美精品一区二区三区在线| 蜜桃一区二区三区在线观看| 在线综合+亚洲+欧美中文字幕| 亚洲一区二区精品视频| 91丨九色丨黑人外教| 中文字幕在线不卡一区二区三区| 国产精品18久久久久久久久久久久 | 日韩欧美的一区二区| 蜜臀av性久久久久蜜臀aⅴ | 在线观看成人免费视频| 亚洲婷婷综合久久一本伊一区| www.视频一区| 中文字幕视频一区二区三区久| 成年人国产精品| 亚洲久草在线视频| 欧美无砖专区一中文字| 亚洲va欧美va国产va天堂影院| 欧美日韩免费视频| 蜜臀av一区二区| 久久综合狠狠综合| 成人激情电影免费在线观看| 亚洲色图欧美在线| 欧美日韩国产经典色站一区二区三区| 天天综合网天天综合色| 欧美一区二区啪啪| 国产成人自拍高清视频在线免费播放| 国产欧美中文在线| 日本韩国一区二区三区| 日本中文字幕一区| 久久久久久9999| 色狠狠一区二区三区香蕉| 亚洲成人tv网| 精品国产乱码久久| 99视频超级精品| 日本欧美在线观看| 国产日产亚洲精品系列| 一本大道av一区二区在线播放| 视频在线观看91| 国产喂奶挤奶一区二区三区| 一本久道久久综合中文字幕| 免费人成精品欧美精品|