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

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

?? savaipinfo.java~2~

?? Java課程設(shè)計(jì)案例精編光盤源碼
?? 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());
   }
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
激情亚洲综合在线| 在线观看视频欧美| 精品一区二区三区久久| 天天色综合成人网| 三级久久三级久久| 日本不卡免费在线视频| 蜜桃91丨九色丨蝌蚪91桃色| 麻豆精品一区二区| 激情av综合网| 国产成人啪免费观看软件| 成人午夜视频网站| 不卡一区二区三区四区| 不卡电影一区二区三区| 91啪亚洲精品| 欧美日韩美少妇| 日韩一级片在线播放| 欧美一二三在线| 久久久99免费| 亚洲视频免费在线观看| 亚洲综合色丁香婷婷六月图片| 亚洲国产一区二区在线播放| 日韩综合一区二区| 久久91精品国产91久久小草| 国产成人综合视频| 色又黄又爽网站www久久| 欧美日韩国产美| 欧美大片日本大片免费观看| 国产欧美一区二区精品性色| 中文字幕不卡在线播放| 亚洲精品国产一区二区三区四区在线 | 在线播放日韩导航| 日韩精品一区二区三区中文不卡| 久久久精品国产免大香伊| 亚洲欧美视频在线观看视频| 亚洲国产精品久久一线不卡| 久久精品99国产国产精| 成人美女视频在线看| 欧美私人免费视频| 26uuu另类欧美亚洲曰本| 亚洲欧美日韩国产另类专区| 婷婷综合五月天| 国产传媒久久文化传媒| 欧美网站一区二区| 国产亚洲欧洲997久久综合| 一区二区三区在线观看国产| 美女被吸乳得到大胸91| 972aa.com艺术欧美| 欧美大片日本大片免费观看| 国内精品在线播放| 色老头久久综合| 精品国产一区久久| 亚洲乱码国产乱码精品精的特点| 麻豆精品在线观看| 91色在线porny| 精品国产髙清在线看国产毛片| 亚洲人成伊人成综合网小说| 久久不见久久见免费视频1| 91在线porny国产在线看| 91精品国产黑色紧身裤美女| 中文字幕一区二区三区蜜月| 久久精品国产网站| 在线观看视频一区二区| 中文字幕免费一区| 久久99热这里只有精品| 欧美亚洲动漫精品| 国产精品美女一区二区在线观看| 日本欧美一区二区| 色哟哟国产精品免费观看| 国产婷婷色一区二区三区| 琪琪久久久久日韩精品| 91福利在线导航| 中文字幕 久热精品 视频在线| 日本aⅴ免费视频一区二区三区 | 中文字幕av一区二区三区免费看| 日本午夜精品视频在线观看 | 777a∨成人精品桃花网| 亚洲精品一卡二卡| 粉嫩绯色av一区二区在线观看| 日韩欧美亚洲一区二区| 亚洲成人动漫在线免费观看| 一本色道久久综合亚洲91| 国产精品卡一卡二| 国产一区在线看| 日韩欧美国产综合一区 | 国产精品一区二区三区网站| 91精品国产综合久久久久久久| 一区二区三区欧美激情| 99热在这里有精品免费| 国产69精品久久99不卡| 精品国产亚洲在线| 捆绑调教一区二区三区| 91麻豆精品国产自产在线观看一区| 亚洲午夜成aⅴ人片| 欧美系列亚洲系列| 亚洲自拍偷拍av| 色狠狠色噜噜噜综合网| 亚洲卡通欧美制服中文| 99国产欧美久久久精品| 中文字幕在线免费不卡| 成人免费视频网站在线观看| 日本一二三不卡| 成人av在线观| 亚洲三级久久久| 在线观看欧美精品| 亚洲成在人线在线播放| 欧美久久久一区| 日韩电影在线一区| 精品免费国产一区二区三区四区| 韩国三级电影一区二区| 久久日韩粉嫩一区二区三区| 国产成人精品影院| 中文字幕一区二区三区视频 | 一区二区中文视频| 色综合天天综合| 亚洲主播在线观看| 欧美一区二区三区视频免费 | 91女厕偷拍女厕偷拍高清| 亚洲视频一区二区在线| 色婷婷久久99综合精品jk白丝| 亚洲一区二区偷拍精品| 欧美电影影音先锋| 久久99精品久久久久久国产越南| 久久色中文字幕| 99v久久综合狠狠综合久久| 亚洲综合免费观看高清完整版| 777午夜精品视频在线播放| 精品一区二区在线播放| 中文字幕av一区二区三区| 色老汉av一区二区三区| 蜜桃视频在线观看一区| 国产欧美综合在线| 欧美在线看片a免费观看| 久久精品免费观看| 亚洲国产精品av| 欧美系列亚洲系列| 国产乱一区二区| 亚洲免费在线观看视频| 91精品中文字幕一区二区三区| 韩国av一区二区三区四区| 中文字幕在线不卡一区| 91精品国产综合久久香蕉麻豆 | 日韩欧美资源站| 成人永久免费视频| 亚洲电影在线免费观看| 26uuu国产日韩综合| 色婷婷综合久久久久中文一区二区 | 亚欧色一区w666天堂| 久久综合国产精品| 色偷偷88欧美精品久久久| 久久国产乱子精品免费女| 国产精品第一页第二页第三页| 国产一区二区三区高清播放| 欧美性xxxxxx少妇| 91精品国产综合久久久久久久 | 国产美女视频一区| 国产精品二区一区二区aⅴ污介绍| 欧美性受极品xxxx喷水| 国内精品免费在线观看| 亚洲综合成人在线| 国产精品视频看| 日韩美女一区二区三区| 色综合色综合色综合色综合色综合| 久久精品99国产精品| 亚洲综合色网站| 欧美精彩视频一区二区三区| 欧美一级精品大片| 日本韩国精品在线| 国产成人在线色| 日韩电影一区二区三区| 一区二区三区四区不卡视频| 国产偷v国产偷v亚洲高清| 欧美一激情一区二区三区| 91黄视频在线观看| 丁香网亚洲国际| 久久精品国产一区二区三| 亚洲制服丝袜一区| 自拍偷自拍亚洲精品播放| 欧美刺激脚交jootjob| 欧美人妇做爰xxxⅹ性高电影| av中文字幕不卡| 国产精品一区二区久激情瑜伽| 日韩激情视频网站| 亚洲一级电影视频| 亚洲私人影院在线观看| 国产日韩欧美激情| 欧美精品一区二区三区在线播放| 欧美日韩高清不卡| 欧美日韩一区二区在线视频| 色噜噜偷拍精品综合在线| 成人午夜电影小说| 国产精品一区二区在线观看不卡| 久久精品二区亚洲w码| 日本亚洲一区二区| 日韩国产高清影视| 亚洲成人激情av| 五月天激情综合网| 日韩精品91亚洲二区在线观看| 亚洲一区视频在线| 亚洲国产cao| 五月婷婷综合在线|