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

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

?? saveipinfo.java~2~

?? 這是一個通過java 編程的學生信息管理系統(tǒng)和學籍管理系統(tǒng)
?? JAVA~2~
字號:
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 SaveIPInfo {


   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());
   }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品高潮呻吟| 精品一区二区三区欧美| 免费人成黄页网站在线一区二区| 国产高清亚洲一区| 欧美丰满少妇xxxbbb| 亚洲日本成人在线观看| 国产福利91精品| 欧美一区欧美二区| 亚洲国产精品一区二区www| 成人国产精品视频| 久久久久97国产精华液好用吗| 丝袜亚洲另类欧美| 欧美日韩一区二区在线视频| 中文字幕一区二区三区不卡| 国产风韵犹存在线视精品| 精品国产自在久精品国产| 亚洲一区成人在线| 色婷婷久久久综合中文字幕| 中文字幕日韩精品一区| 国产成人综合视频| 国产亚洲成年网址在线观看| 久久电影网站中文字幕| 日韩色视频在线观看| 婷婷夜色潮精品综合在线| 色哟哟一区二区| 亚洲黄色小视频| 91福利视频在线| 亚洲国产视频在线| 91黄视频在线| 亚洲一区二区高清| 欧美唯美清纯偷拍| 亚洲成人激情自拍| 日韩一区二区三区在线观看| 日本三级韩国三级欧美三级| 正在播放一区二区| 老鸭窝一区二区久久精品| 日韩欧美专区在线| 久久国产精品区| 国产拍欧美日韩视频二区| 成人免费高清视频在线观看| 国产精品免费视频一区| 91在线观看一区二区| 一区二区三区色| 欧美久久免费观看| 精品一区二区av| 国产欧美日韩精品一区| 91亚洲男人天堂| 亚洲成人中文在线| 精品电影一区二区三区| 成人免费高清视频| 亚洲一区二区综合| 日韩女同互慰一区二区| 成人丝袜视频网| 亚洲精品国产视频| 在线观看91精品国产麻豆| 精品一区二区在线视频| 国产精品免费视频观看| 91黄色激情网站| 日本少妇一区二区| 中文字幕一区在线观看| 欧美年轻男男videosbes| 国产一区二区三区电影在线观看| 亚洲日本在线视频观看| 日韩一区二区在线观看视频播放| 国产成人日日夜夜| 亚洲午夜电影在线| 国产日韩欧美a| 欧洲精品在线观看| 国产91高潮流白浆在线麻豆 | 日韩欧美高清dvd碟片| 国产精品系列在线观看| 亚洲第一精品在线| 国产亚洲精品aa午夜观看| 在线一区二区三区做爰视频网站| 免费在线视频一区| 亚洲嫩草精品久久| 欧美成人猛片aaaaaaa| 在线一区二区三区四区五区 | 人人爽香蕉精品| 国产精品久久久久精k8| 日韩精品一区二区三区中文不卡 | 7777精品伊人久久久大香线蕉最新版| 激情欧美一区二区三区在线观看| 亚洲精品国产一区二区精华液| 精品处破学生在线二十三| 欧洲精品一区二区| av在线不卡观看免费观看| 美国一区二区三区在线播放| 亚洲精品乱码久久久久久| 精品久久久久香蕉网| 欧美剧在线免费观看网站| 色综合久久久久久久| 国产成人免费在线视频| 蜜桃av一区二区三区| 亚洲超碰精品一区二区| 亚洲欧美怡红院| 亚洲国产电影在线观看| 久久久三级国产网站| 欧美大尺度电影在线| 欧美日韩国产精品自在自线| 色婷婷av一区| 91在线观看免费视频| av影院午夜一区| 国产不卡在线视频| 国产精品亚洲一区二区三区在线| 久久se精品一区精品二区| 天天免费综合色| 日韩中文欧美在线| 亚洲午夜久久久久中文字幕久| 亚洲另类在线视频| 亚洲人成影院在线观看| 国产精品久久久久久久蜜臀| 国产精品视频在线看| 亚洲欧洲精品成人久久奇米网| 中文字幕精品综合| 国产精品区一区二区三| 日本一区二区三级电影在线观看 | 日韩视频在线观看一区二区| 欧美精品自拍偷拍| 日韩亚洲欧美一区| 欧美精品一区二区在线观看| 精品国产乱码久久久久久免费| 久久综合久色欧美综合狠狠| 久久综合网色—综合色88| 欧美国产精品久久| 亚洲欧洲av色图| 亚洲在线免费播放| 日韩国产欧美在线播放| 久久国产视频网| 国产乱码精品一区二区三区忘忧草| 国产一区 二区| av中文字幕一区| 欧美日韩成人在线| 精品欧美乱码久久久久久| 国产人成亚洲第一网站在线播放| 日韩一区日韩二区| 午夜精品久久久久久久久久| 麻豆精品国产传媒mv男同| 国产精品亚洲第一| 91久久人澡人人添人人爽欧美| 在线播放视频一区| 久久―日本道色综合久久| 综合婷婷亚洲小说| 日韩 欧美一区二区三区| 国产成人综合在线播放| 日本精品视频一区二区三区| 日韩一区二区免费电影| 欧美激情资源网| 亚洲国产婷婷综合在线精品| 国产一区二区三区黄视频| 色伊人久久综合中文字幕| 欧美一区二区三区思思人| 国产精品久久久久国产精品日日| 亚洲成av人片一区二区| 粉嫩aⅴ一区二区三区四区| 欧美男男青年gay1069videost| 久久久久久久久久久久久女国产乱| 亚洲精品久久7777| 国产精品123| 欧美一区二区视频在线观看2022| 欧美国产精品v| 精品在线观看免费| 欧美三级韩国三级日本三斤| 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲精品国产精品乱码不99| 国产成人午夜视频| 日韩精品资源二区在线| 樱桃视频在线观看一区| 国产九九视频一区二区三区| 欧美日韩免费视频| 天天色 色综合| 色一情一乱一乱一91av| 久久久久久免费毛片精品| 天堂av在线一区| 欧美在线视频你懂得| 国产精品久久久久久久蜜臀| 国产露脸91国语对白| 日韩午夜激情av| 青草av.久久免费一区| 欧美主播一区二区三区美女| 欧美激情一区不卡| 国产露脸91国语对白| 日韩欧美一区电影| 天天操天天干天天综合网| 色综合天天综合狠狠| 国产精品丝袜一区| 国产**成人网毛片九色| 精品国产乱码久久久久久影片| 日本美女一区二区| 欧美精品 国产精品| 午夜欧美在线一二页| 欧美丝袜丝nylons| 亚洲国产精品久久不卡毛片 | 国产成人精品免费视频网站| 久久天天做天天爱综合色| 奇米影视一区二区三区| 欧美午夜精品免费| 亚洲成人av在线电影| 欧美日韩亚洲另类| 亚洲午夜一区二区三区|