锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲邪恶天堂影院在线观看,亚洲热线99精品视频,亚洲欧洲精品久久http://m.tkk7.com/WshmAndLily/category/10978.htmlzh-cnThu, 14 Feb 2008 17:19:59 GMTThu, 14 Feb 2008 17:19:59 GMT60java jdbchttp://m.tkk7.com/WshmAndLily/articles/179975.htmlsemovysemovyThu, 14 Feb 2008 13:35:00 GMThttp://m.tkk7.com/WshmAndLily/articles/179975.htmlhttp://m.tkk7.com/WshmAndLily/comments/179975.htmlhttp://m.tkk7.com/WshmAndLily/articles/179975.html#Feedback0http://m.tkk7.com/WshmAndLily/comments/commentRss/179975.htmlhttp://m.tkk7.com/WshmAndLily/services/trackbacks/179975.htmlpackage com.semovy.service.impl;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

import com.semovy.bean.Database;

public class SQLServerDatabase implements Database {

 private String driver = null;
 private String pwd = null;
 private String user = null;
 private String url = null;
 private Connection connection = null;
 public String getUrl() {
  return url;
 }
 public void setUrl(String url) {
  this.url = url;
 }
 public String getUser() {
  return user;
 }
 public void setUser(String user) {
  this.user = user;
 }
 public String getDriver() {
  return driver;
 }
 public String getPwd() {
  return pwd;
 }
 public void setDriver(String driver)
 {
  this.driver = driver;
 }
 public void setPwd(String pwd)
 {
  this.pwd = pwd;
 }
 public Connection getConnection()
 {
  openConnection();
  return this.connection;
 }
 public void setConnection(Connection connection) {
  this.connection = connection;
 }
 public List getData() {
  
  return null;
 }
 public SQLServerDatabase(String driver,String url,String user,String pwd)
 {
  this.driver = driver;
  this.url = url;
  this.user = user;
  this.pwd = pwd;
  try
  {
   System.out.println("start");
   Class.forName(this.getDriver()).newInstance();
   this.connection = DriverManager.getConnection(this.getUrl(), this.getUser(), this.getPwd());
   System.out.println("OK");
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
  catch(ClassNotFoundException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
  catch(Exception e)
  {
   System.out.println(e.getLocalizedMessage());
  }
 }
 /**
  *
  * @return
  */
 private Connection openConnection()
 {
  if(this.connection != null)
  { 
   return this.connection;
  } 
  else
  {
   try
   {
    Class.forName(this.getDriver()).newInstance();
    this.connection = DriverManager.getConnection(this.getUrl(), this.getUser(), this.getPwd());
   }catch(SQLException e)
   {
    System.out.println(e.getLocalizedMessage());
   }
   catch(ClassNotFoundException e)
   {
    System.out.println(e.getLocalizedMessage());
   }
   catch(Exception e)
   {
    System.out.println(e.getLocalizedMessage());
   }
   return this.connection; 
  }
  
 }
 public void closeConnection()
 {
  try
  {
   if(this.getConnection() != null && !this.connection.isClosed())
   {
    this.connection.close();
   }
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
 }
 public ResultSet executeQuery(String sqlExp)
 {
  ResultSet rs = null;
  Statement stmt = null;
  try
  {
   stmt = this.getConnection().createStatement();
   rs = stmt.executeQuery(sqlExp);
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
  return rs;
 }
 public void executeUpdate(String sqlExp)
 {
  try
  {
   this.getConnection().createStatement().executeUpdate(sqlExp);
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
 }
 public void executeBatchUpdate()
 {
  try
  {
   long start = System.currentTimeMillis();
   Statement stmt = this.getConnection().createStatement();
   for(int i=0;i < 10000;i++)
   {
    stmt.addBatch("insert into item values(2,'item" + i + "')");
    if(i%500 == 0 && i>0)
     stmt.executeBatch();
   }
   stmt.executeBatch();
   this.getConnection().commit();
   stmt.close();
   stmt = null;
   long spendTime = System.currentTimeMillis() - start;
   System.out.println("鍚戞暟鎹簱鎻掑叆涓涓囨潯璁板綍鐢ㄥ幓:" +  spendTime*1.0/1000 + " s");
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
 }
 public void display(ResultSet rs)
 {
  try
  {
   ResultSetMetaData rsmd =  rs.getMetaData();
   int colLen = rsmd.getColumnCount();
   while(rs.next())
   {
    for(int i=0; i<colLen;i++)
    {
     System.out.print(rsmd.getColumnName(i+1) + ": " + rs.getObject(i+1) + "  ");
    }
    System.out.println();
   }
   
  }catch(SQLException e)
  {
   System.out.println(e.getLocalizedMessage());
  }
  
 }
}



package com.semovy.test;

import com.semovy.service.impl.SQLServerDatabase;

public class TestHelloWorld {

 public static void main(String[] args) {

  // ApplicationContext appContext = new
  // FileSystemXmlApplicationContext("classpath:config.xml");
  // Hello hello = (Hello)appContext.getBean("hello");
  // hello.saySaluation();
  // IoC Inversion of Control 鍙嶅悜鎺у埗.
  // 鍙戞槑鑰呮柊鍛藉悕涓?DI dipendency Injection 渚濊禆娉ㄥ叆.
  // 鍙嶅悜鎺у埗鏄疄鐜頒緷璧栨娊璞?涓嶆槸鎶借薄渚濊禆瀹炵幇.
  SQLServerDatabase sqlServerDB = new SQLServerDatabase(
    "com.microsoft.jdbc.sqlserver.SQLServerDriver", "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=test",
    "sa", "1234");
  sqlServerDB.executeUpdate("drop table item if exist create table item(id int not null identity(1,1) primary key,int categoryId not null,itemName varchar(255) default '')");
  sqlServerDB.executeUpdate("delete from item");
  sqlServerDB.executeBatchUpdate();
  sqlServerDB.display(sqlServerDB.executeQuery("select top 100 * from item"));
  sqlServerDB.closeConnection();
 }

}



semovy 2008-02-14 21:35 鍙戣〃璇勮
]]>
JDBC瀛樺彇ORACLE澶у瀷鏁版嵁瀵硅薄LOB鍑犵鎯呭喌鐨勭ず鑼冪被http://m.tkk7.com/WshmAndLily/articles/103592.htmlsemovysemovyTue, 13 Mar 2007 09:29:00 GMThttp://m.tkk7.com/WshmAndLily/articles/103592.htmlhttp://m.tkk7.com/WshmAndLily/comments/103592.htmlhttp://m.tkk7.com/WshmAndLily/articles/103592.html#Feedback0http://m.tkk7.com/WshmAndLily/comments/commentRss/103592.htmlhttp://m.tkk7.com/WshmAndLily/services/trackbacks/103592.htmlimport聽java.util.*;
import聽java.sql.*;
聽聽
public聽class聽LobPros
{
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽orACLE椹卞姩紼嬪簭
聽聽聽聽聽*/
聽聽聽聽private聽static聽final聽String聽DRIVER聽=聽"oracle.jdbc.driver.OracleDriver";
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽orACLE榪炴帴鐢║RL
聽聽聽聽聽*/
聽聽聽聽private聽static聽final聽String聽URL聽=聽"jdbc:oracle:thin:@test2000:1521:orac";
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽鐢ㄦ埛鍚?br />聽聽聽聽聽*/
聽聽聽聽private聽static聽final聽String聽USER聽=聽"user";
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽瀵嗙爜
聽聽聽聽聽*/
聽聽聽聽private聽static聽final聽String聽PASSWORD聽=聽"pswd";
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽鏁版嵁搴撹繛鎺?br />聽聽聽聽聽*/
聽聽聽聽private聽static聽Connection聽conn聽=聽null;
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽SQL璇彞瀵硅薄
聽聽聽聽聽*/
聽聽聽聽private聽static聽Statement聽stmt聽=聽null;
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽@roseuid聽3EDA089E02BC
聽聽聽聽聽*/
聽聽聽聽public聽LobPros()
聽聽聽聽{
聽聽
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽寰鏁版嵁搴撲腑鎻掑叆涓涓柊鐨凜LOB瀵硅薄
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04A902BC
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽clobInsert(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鎻掑叆涓涓┖鐨凜LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Insert聽INTO聽TEST_CLOB聽VALUES聽('111',聽EMPTY_CLOB())");
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨ姝LOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽CLOBCOL聽FROM聽TEST_CLOB聽Where聽ID='111'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍙栧嚭姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.CLOB聽clob聽=聽(oracle.sql.CLOB)rs.getClob("CLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍚慍LOB瀵硅薄涓啓鍏ユ暟鎹?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedWriter聽out聽=聽new聽BufferedWriter(clob.getCharacterOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedReader聽in聽=聽new聽BufferedReader(new聽FileReader(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽淇敼CLOB瀵硅薄錛堟槸鍦ㄥ師CLOB瀵硅薄鍩虹涓婅繘琛岃鐩栧紡鐨勪慨鏀癸級
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04B60367
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽clobModify(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨCLOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽CLOBCOL聽FROM聽TEST_CLOB聽Where聽ID='111'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鑾峰彇姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.CLOB聽clob聽=聽(oracle.sql.CLOB)rs.getClob("CLOBCOL");聽聽
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽榪涜瑕嗙洊寮忎慨鏀孤?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedWriter聽out聽=聽new聽BufferedWriter(clob.getCharacterOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedReader聽in聽=聽new聽BufferedReader(new聽FileReader(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽鏇挎崲CLOB瀵硅薄錛堝皢鍘烠LOB瀵硅薄娓呴櫎錛屾崲鎴愪竴涓叏鏂扮殑CLOB瀵硅薄錛?br />聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04BF01E1
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽clobReplace(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽娓呯┖鍘烠LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Update聽TEST_CLOB聽SET聽CLOBCOL=EMPTY_CLOB()聽Where聽ID='111'");
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨCLOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽CLOBCOL聽FROM聽TEST_CLOB聽Where聽ID='111'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鑾峰彇姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.CLOB聽clob聽=聽(oracle.sql.CLOB)rs.getClob("CLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏇存柊鏁版嵁聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedWriter聽out聽=聽new聽BufferedWriter(clob.getCharacterOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedReader聽in聽=聽new聽BufferedReader(new聽FileReader(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽CLOB瀵硅薄璇誨彇
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽outfile聽-聽杈撳嚭鏂囦歡鍚?br />聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04D80116
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽clobRead(String聽outfile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨCLOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽*聽FROM聽TEST_CLOB聽Where聽ID='111'");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鑾峰彇CLOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.CLOB聽clob聽=聽(oracle.sql.CLOB)rs.getClob("CLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽浠ュ瓧絎﹀艦寮忚緭鍑郝?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedReader聽in聽=聽new聽BufferedReader(clob.getCharacterStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedWriter聽out聽=聽new聽BufferedWriter(new聽FileWriter(outfile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽鍚戞暟鎹簱涓彃鍏ヤ竴涓柊鐨凚LOB瀵硅薄
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04E300F6
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽blobInsert(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鎻掑叆涓涓┖鐨凚LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Insert聽INTO聽TEST_BLOB聽VALUES聽('222',聽EMPTY_BLOB())");
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨ姝LOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽BLOBCOL聽FROM聽TEST_BLOB聽Where聽ID='222'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍙栧嚭姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.BLOB聽blob聽=聽(oracle.sql.BLOB)rs.getBlob("BLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍚態LOB瀵硅薄涓啓鍏ユ暟鎹?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedOutputStream聽out聽=聽new聽BufferedOutputStream(blob.getBinaryOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedInputStream聽in聽=聽new聽BufferedInputStream(new聽FileInputStream(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽淇敼BLOB瀵硅薄錛堟槸鍦ㄥ師BLOB瀵硅薄鍩虹涓婅繘琛岃鐩栧紡鐨勪慨鏀癸級
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA04E90106
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽blobModify(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨBLOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽BLOBCOL聽FROM聽TEST_BLOB聽Where聽ID='222'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍙栧嚭姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.BLOB聽blob聽=聽(oracle.sql.BLOB)rs.getBlob("BLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍚態LOB瀵硅薄涓啓鍏ユ暟鎹?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedOutputStream聽out聽=聽new聽BufferedOutputStream(blob.getBinaryOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedInputStream聽in聽=聽new聽BufferedInputStream(new聽FileInputStream(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽鏇挎崲BLOB瀵硅薄錛堝皢鍘烞LOB瀵硅薄娓呴櫎錛屾崲鎴愪竴涓叏鏂扮殑BLOB瀵硅薄錛?br />聽聽聽聽聽*
聽聽聽聽聽*聽@param聽infile聽-聽鏁版嵁鏂囦歡
聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA0505000C
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽blobReplace(String聽infile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽娓呯┖鍘烞LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Update聽TEST_BLOB聽SET聽BLOBCOL=EMPTY_BLOB()聽Where聽ID='222'");
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨ姝LOB瀵硅薄騫墮攣瀹毬?/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽BLOBCOL聽FROM聽TEST_BLOB聽Where聽ID='222'聽FOR聽Update");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍙栧嚭姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.BLOB聽blob聽=聽(oracle.sql.BLOB)rs.getBlob("BLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍚態LOB瀵硅薄涓啓鍏ユ暟鎹?/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedOutputStream聽out聽=聽new聽BufferedOutputStream(blob.getBinaryOutputStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedInputStream聽in聽=聽new聽BufferedInputStream(new聽FileInputStream(infile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽BLOB瀵硅薄璇誨彇
聽聽聽聽聽*
聽聽聽聽聽*聽@param聽outfile聽-聽杈撳嚭鏂囦歡鍚?br />聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA050B003B
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽blobRead(String聽outfile)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽璁懼畾涓嶈嚜鍔ㄦ彁浜ぢ?/
聽聽聽聽聽聽聽聽boolean聽defaultCommit聽=聽conn.getAutoCommit();
聽聽聽聽聽聽聽聽conn.setAutoCommit(false);
聽聽
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鏌ヨBLOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽ResultSet聽rs聽=聽stmt.executeQuery("Select聽BLOBCOL聽FROM聽TEST_BLOB聽Where聽ID='222'");
聽聽聽聽聽聽聽聽聽聽聽聽while聽(rs.next())聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍙栧嚭姝LOB瀵硅薄聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽oracle.sql.BLOB聽blob聽=聽(oracle.sql.BLOB)rs.getBlob("BLOBCOL");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽/*聽浠ヤ簩榪涘埗褰㈠紡杈撳嚭聽*/
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedOutputStream聽out聽=聽new聽BufferedOutputStream(new聽FileOutputStream(outfile));
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽BufferedInputStream聽in聽=聽new聽BufferedInputStream(blob.getBinaryStream());
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽int聽c;
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽while聽((c=in.read())!=-1)聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.write(c);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽in.close();
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽out.close();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽/*聽姝e紡鎻愪氦聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.commit();
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽/*聽鍑洪敊鍥炴粴聽*/
聽聽聽聽聽聽聽聽聽聽聽聽conn.rollback();
聽聽聽聽聽聽聽聽聽聽聽聽throw聽ex;
聽聽聽聽聽聽聽聽}
聽聽
聽聽聽聽聽聽聽聽/*聽鎭㈠鍘熸彁浜ょ姸鎬伮?/
聽聽聽聽聽聽聽聽conn.setAutoCommit(defaultCommit);
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽寤虹珛嫻嬭瘯鐢ㄨ〃鏍?br />聽聽聽聽聽*聽@throws聽Exception
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽createTables()聽throws聽Exception聽{
聽聽聽聽聽聽聽聽try聽{
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Create聽TABLE聽TEST_CLOB聽(聽ID聽NUMBER(3),聽CLOBCOL聽CLOB)");
聽聽聽聽聽聽聽聽聽聽聽聽stmt.executeUpdate("Create聽TABLE聽TEST_BLOB聽(聽ID聽NUMBER(3),聽BLOBCOL聽BLOB)");
聽聽聽聽聽聽聽聽}聽catch聽(Exception聽ex)聽{
聽聽
聽聽聽聽聽聽聽聽}
聽聽聽聽}
聽聽
聽聽聽聽/**
聽聽聽聽聽*聽@param聽args聽-聽鍛戒護琛屽弬鏁?br />聽聽聽聽聽*聽@throws聽java.lang.Exception
聽聽聽聽聽*聽@roseuid聽3EDA052002AC
聽聽聽聽聽*/
聽聽聽聽public聽static聽void聽main(String[]聽args)聽throws聽Exception
聽聽聽聽{
聽聽聽聽聽聽聽聽/*聽瑁呰澆椹卞姩,寤虹珛鏁版嵁搴撹繛鎺ヂ?/
聽聽聽聽聽聽聽聽Class.forName(DRIVER);
聽聽聽聽聽聽聽聽conn聽=聽DriverManager.getConnection(URL,USER,PASSWORD);
聽聽聽聽聽聽聽聽stmt聽=聽conn.createStatement();
聽聽
聽聽聽聽聽聽聽聽/*聽寤虹珛嫻嬭瘯琛ㄦ牸聽*/
聽聽聽聽聽聽聽聽createTables();
聽聽
聽聽聽聽聽聽聽聽/*聽CLOB瀵硅薄鎻掑叆嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽clobInsert("c:/clobInsert.txt");
聽聽聽聽聽聽聽聽clobRead("c:/clobInsert.out");
聽聽
聽聽聽聽聽聽聽聽/*聽CLOB瀵硅薄淇敼嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽clobModify("c:/clobModify.txt");
聽聽聽聽聽聽聽聽clobRead("c:/clobModify.out");
聽聽
聽聽聽聽聽聽聽聽/*聽CLOB瀵硅薄鏇挎崲嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽clobReplace("c:/clobReplace.txt");
聽聽聽聽聽聽聽聽clobRead("c:/clobReplace.out");
聽聽
聽聽聽聽聽聽聽聽/*聽BLOB瀵硅薄鎻掑叆嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽blobInsert("c:/blobInsert.doc");
聽聽聽聽聽聽聽聽blobRead("c:/blobInsert.out");
聽聽
聽聽聽聽聽聽聽聽/*聽BLOB瀵硅薄淇敼嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽blobModify("c:/blobModify.doc");
聽聽聽聽聽聽聽聽blobRead("c:/blobModify.out");
聽聽
聽聽聽聽聽聽聽聽/*聽BLOB瀵硅薄鏇挎崲嫻嬭瘯聽*/
聽聽聽聽聽聽聽聽blobReplace("c:/blobReplace.doc");
聽聽聽聽聽聽聽聽blobRead("c:/bolbReplace.out");
聽聽
聽聽聽聽聽聽聽聽/*聽鍏抽棴璧勬簮閫鍑郝?/
聽聽聽聽聽聽聽聽conn.close();
聽聽聽聽聽聽聽聽System.exit(0);
聽聽聽聽}
}


semovy 2007-03-13 17:29 鍙戣〃璇勮
]]>
JDBC榪炴帴鍚勭鏁版嵁搴撶粡楠屾妧宸ч泦钀?/title><link>http://m.tkk7.com/WshmAndLily/articles/75242.html</link><dc:creator>semovy</dc:creator><author>semovy</author><pubDate>Sun, 15 Oct 2006 03:31:00 GMT</pubDate><guid>http://m.tkk7.com/WshmAndLily/articles/75242.html</guid><wfw:comment>http://m.tkk7.com/WshmAndLily/comments/75242.html</wfw:comment><comments>http://m.tkk7.com/WshmAndLily/articles/75242.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/WshmAndLily/comments/commentRss/75242.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/WshmAndLily/services/trackbacks/75242.html</trackback:ping><description><![CDATA[Java鏁版嵁搴撹繛鎺ワ紙JDBC錛夌敱涓緇勭敤 Java 緙栫▼璇█緙栧啓鐨勭被鍜屾帴鍙g粍鎴愩侸DBC 涓哄伐鍏?鏁版嵁搴撳紑鍙戜漢鍛樻彁渚涗簡涓涓爣鍑嗙殑 API錛屼嬌浠栦滑鑳藉鐢ㄧ函Java API 鏉ョ紪鍐欐暟鎹簱搴旂敤紼嬪簭銆傜劧鑰屽悇涓紑鍙戝晢鐨勬帴鍙e茍涓嶅畬鍏ㄧ浉鍚岋紝鎵浠ュ紑鍙戠幆澧冪殑鍙樺寲浼氬甫鏉ヤ竴瀹氱殑閰嶇疆鍙樺寲銆傛湰鏂囦富瑕侀泦鍚堜簡涓嶅悓鏁版嵁搴撶殑榪炴帴鏂瑰紡銆?br /><br />銆銆<strong>涓銆佽繛鎺ュ悇縐嶆暟鎹簱鏂瑰紡閫熸煡琛?br /></strong><br />銆銆涓嬮潰緗楀垪浜嗗悇縐嶆暟鎹簱浣跨敤JDBC榪炴帴鐨勬柟寮忥紝鍙互浣滀負涓涓墜鍐屼嬌鐢ㄣ?<br /><br />銆銆<strong>1銆丱racle8/8i/9i鏁版嵁搴擄紙thin妯″紡錛?/strong><br /><p class="code">Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); <br />String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl涓烘暟鎹簱鐨凷ID <br />String user="test"; <br />String password="test"; <br />Connection conn= DriverManager.getConnection(url,user,password);</p><br /><br />銆銆<strong>2銆丏B2鏁版嵁搴?/strong><br /><p class="code">Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance(); <br />String url="jdbc:db2://localhost:5000/sample"; //sample涓轟綘鐨勬暟鎹簱鍚?<br />String user="admin"; <br />String password=""; <br />Connection conn= DriverManager.getConnection(url,user,password);</p><br /><br />銆銆<strong>3銆丼ql Server7.0/2000鏁版嵁搴?/strong><br /><p class="code">Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); <br />String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb"; <br />//mydb涓烘暟鎹簱 <br />String user="sa"; <br />String password=""; <br />Connection conn= DriverManager.getConnection(url,user,password);</p><br /><br />銆銆<strong>4銆丼ybase鏁版嵁搴?/strong><br /><p class="code">Class.forName("com.sybase.jdbc.SybDriver").newInstance(); <br />String url =" jdbc:sybase:Tds:localhost:5007/myDB";//myDB涓轟綘鐨勬暟鎹簱鍚?<br />Properties sysProps = System.getProperties(); <br />SysProps.put("user","userid"); <br />SysProps.put("password","user_password"); <br />Connection conn= DriverManager.getConnection(url, SysProps);<br /><br /><strong>5銆両nformix鏁版嵁搴?/strong><br /></p><p class="code">Class.forName("com.informix.jdbc.IfxDriver").newInstance(); <br />String url = "jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver; <br />user=testuser;password=testpassword"; //myDB涓烘暟鎹簱鍚?<br />Connection conn= DriverManager.getConnection(url);</p><p class="code"><br /><br />銆銆<strong>6銆丮ySQL鏁版嵁搴?/strong><br /></p><p class="code">Class.forName("org.gjt.mm.mysql.Driver").newInstance(); <br />String url ="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1" <br />//myDB涓烘暟鎹簱鍚?<br />Connection conn= DriverManager.getConnection(url);</p><p class="code"><br /><br />銆銆<strong>7銆丳ostgreSQL鏁版嵁搴?/strong><br /></p><p class="code">Class.forName("org.postgresql.Driver").newInstance(); <br />String url ="jdbc:postgresql://localhost/myDB" //myDB涓烘暟鎹簱鍚?<br />String user="myuser"; <br />String password="mypassword"; <br />Connection conn= DriverManager.getConnection(url,user,password);</p><p class="code"><br /><br />銆銆<strong>8銆乤ccess鏁版嵁搴撶洿榪炵敤ODBC鐨?br /></strong></p><p class="code">Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;<br />String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");<br />Connection conn = DriverManager.getConnection(url,"","");<br />Statement stmtNew=conn.createStatement() ;</p><p class="code"><br /><br />銆銆<strong>浜屻丣DBC榪炴帴MySql鏂瑰紡</strong><br /><br />銆銆涓嬮潰鏄嬌鐢↗DBC榪炴帴MySql鐨勪竴涓皬鐨勬暀紼?<br /><br />銆銆<strong>1銆佹煡鎵鵑┍鍔ㄧ▼搴?/strong><br /><br />銆銆MySQL鐩墠鎻愪緵鐨刯ava椹卞姩紼嬪簭涓篊onnection/J錛屽彲浠ヤ粠MySQL瀹樻柟緗戠珯涓嬭澆錛屽茍鎵懼埌mysql-connector-java-3.0.15-ga-bin.jar鏂囦歡錛屾椹卞姩紼嬪簭涓虹函java椹卞姩紼嬪簭錛屼笉闇鍋氬叾浠栭厤緗?br /><br /><strong>2銆佸姩鎬佹寚瀹歝lasspath<br /><br /></strong>銆銆濡傛灉闇瑕佹墽琛屾椂鍔ㄦ佹寚瀹歝lasspath錛屽氨鍦ㄦ墽琛屾椂閲囩敤錛峜p鏂瑰紡銆傚惁鍒欏皢涓婇潰鐨?jar鏂囦歡鍔犲叆鍒癱lasspath鐜鍙橀噺涓?br /><br />銆銆<strong>3銆佸姞杞介┍鍔ㄧ▼搴?/strong><br /></p><p class="code">try{<br />銆Class.forName(com.mysql.jdbc.Driver);<br />銆System.out.println(Success loading Mysql Driver!);<br />}catch(Exception e)<br />{<br />銆System.out.println(Error loading Mysql Driver!);<br />銆e.printStackTrace();<br />}</p><p class="code"><br /><br />銆銆<strong>4銆佽緗繛鎺ョ殑url</strong><br /><br />jdbc錛歮ysql錛?/localhost/databasename[?pa=va][錛唒a=va] <br /><br />銆銆<strong>涓夈佷互涓嬪垪鍑轟簡鍦ㄤ嬌鐢↗DBC鏉ヨ繛鎺racle鏁版嵁搴撴椂鍙互浣跨敤鐨勪竴浜涙妧宸?/strong><br /><br />銆銆<strong>1銆佸湪瀹㈡埛绔蔣浠跺紑鍙戜腑浣跨敤Thin椹卞姩紼嬪簭</strong><br /><br />銆銆鍦ㄥ紑鍙慗ava杞歡鏂歸潰錛孫racle鐨勬暟鎹簱鎻愪緵浜嗗洓縐嶇被鍨嬬殑椹卞姩紼嬪簭錛屼簩縐嶇敤浜庡簲鐢ㄨ蔣浠躲乤pplets銆乻ervlets絳夊鎴風杞歡錛屽彟澶栦簩縐嶇敤浜庢暟鎹簱涓殑Java瀛樺偍榪囩▼絳夋湇鍔″櫒绔蔣浠躲傚湪瀹㈡埛鏈虹杞歡鐨勫紑鍙戜腑錛屾垜浠彲浠ラ夋嫨OCI椹卞姩紼嬪簭鎴朤hin椹卞姩紼嬪簭銆侽CI椹卞姩紼嬪簭鍒╃敤Java鏈湴鍖栨帴鍙o紙JNI錛夛紝閫氳繃Oracle瀹㈡埛绔蔣浠朵笌鏁版嵁搴撹繘琛岄氳銆俆hin椹卞姩紼嬪簭鏄函Java椹卞姩紼嬪簭錛屽畠鐩存帴涓庢暟鎹簱榪涜閫氳銆備負浜嗚幏寰楁渶楂樼殑鎬ц兘錛孫racle寤鴻鍦ㄥ鎴風杞歡鐨勫紑鍙戜腑浣跨敤OCI椹卞姩紼嬪簭錛岃繖浼間箮鏄紜殑銆備絾鎴戝緩璁嬌鐢═hin椹卞姩紼嬪簭錛屽洜涓洪氳繃澶氭嫻嬭瘯鍙戠幇錛屽湪閫氬父鎯呭喌涓嬶紝Thin椹卞姩紼嬪簭鐨勬ц兘閮借秴榪囦簡OCI椹卞姩紼嬪簭銆?br /><br />銆銆<strong>2銆佸叧闂嚜鍔ㄦ彁浜ゅ姛鑳斤紝鎻愰珮緋葷粺鎬ц兘</strong><br /><br />銆銆鍦ㄧ涓嬈″緩绔嬩笌鏁版嵁搴撶殑榪炴帴鏃訛紝鍦ㄧ己鐪佹儏鍐典笅錛岃繛鎺ユ槸鍦ㄨ嚜鍔ㄦ彁浜ゆā寮忎笅鐨勩備負浜嗚幏寰楁洿濂界殑鎬ц兘錛屽彲浠ラ氳繃璋冪敤甯﹀竷灝斿糵alse鍙傛暟鐨凜onnection綾葷殑setAutoCommit()鏂規硶鍏抽棴鑷姩鎻愪氦鍔熻兘錛屽涓嬫墍紺猴細<br /></p><p class="code">銆銆conn.setAutoCommit(false);</p><p class="code"><br />銆銆鍊煎緱娉ㄦ剰鐨勬槸錛屼竴鏃﹀叧闂簡鑷姩鎻愪氦鍔熻兘錛屾垜浠氨闇瑕侀氳繃璋冪敤Connection綾葷殑commit()鍜宺ollback()鏂規硶鏉ヤ漢宸ョ殑鏂瑰紡瀵逛簨鍔¤繘琛岀鐞嗐?br /><br /><strong>3銆佸湪鍔ㄦ丼QL鎴栨湁鏃墮棿闄愬埗鐨勫懡浠や腑浣跨敤Statement瀵硅薄<br /><br /></strong>銆銆鍦ㄦ墽琛孲QL鍛戒護鏃訛紝鎴戜滑鏈変簩縐嶉夋嫨錛氬彲浠ヤ嬌鐢≒reparedStatement瀵硅薄錛屼篃鍙互浣跨敤Statement瀵硅薄銆傛棤璁哄灝戞鍦頒嬌鐢ㄥ悓涓涓猄QL鍛戒護錛孭reparedStatement閮藉彧瀵瑰畠瑙f瀽鍜岀紪璇戜竴嬈°傚綋浣跨敤Statement瀵硅薄鏃訛紝姣忔鎵ц涓涓猄QL鍛戒護鏃訛紝閮戒細瀵瑰畠榪涜瑙f瀽鍜岀紪璇戙傝繖鍙兘浼氫嬌浣犺涓猴紝浣跨敤PreparedStatement瀵硅薄姣斾嬌鐢⊿tatement瀵硅薄鐨勯熷害鏇村揩銆傜劧鑰岋紝鎴戣繘琛岀殑嫻嬭瘯琛ㄦ槑錛屽湪瀹㈡埛绔蔣浠朵腑錛屾儏鍐靛茍闈炲姝ゃ傚洜姝わ紝鍦ㄦ湁鏃墮棿闄愬埗鐨凷QL鎿嶄綔涓紝闄ら潪鎴愭壒鍦板鐞哠QL鍛戒護錛屾垜浠簲褰撹冭檻浣跨敤Statement瀵硅薄銆?br /><br />銆銆姝ゅ錛屼嬌鐢⊿tatement瀵硅薄涔熶嬌寰楃紪鍐欏姩鎬丼QL鍛戒護鏇村姞綆鍗曪紝鍥犱負鎴戜滑鍙互灝嗗瓧絎︿覆榪炴帴鍦ㄤ竴璧鳳紝寤虹珛涓涓湁鏁堢殑SQL鍛戒護銆傚洜姝わ紝鎴戣涓猴紝Statement瀵硅薄鍙互浣垮姩鎬丼QL鍛戒護鐨勫垱寤哄拰鎵ц鍙樺緱鏇村姞綆鍗曘?br /><br />銆銆<strong>4銆佸埄鐢╤elper鍑芥暟瀵瑰姩鎬丼QL鍛戒護榪涜鏍煎紡鍖?/strong><br /><br />銆銆鍦ㄥ垱寤轟嬌鐢⊿tatement瀵硅薄鎵ц鐨勫姩鎬丼QL鍛戒護鏃訛紝鎴戜滑闇瑕佸鐞嗕竴浜涙牸寮忓寲鏂歸潰鐨勯棶棰樸備緥濡傦紝濡傛灉鎴戜滑鎯沖垱寤轟竴涓皢鍚嶅瓧O'Reilly鎻掑叆琛ㄤ腑鐨凷QL鍛戒護錛屽垯蹇呴』浣跨敤浜屼釜鐩歌繛鐨勨?'鈥濆彿鏇挎崲O'Reilly涓殑鈥?鈥濆彿銆傚畬鎴愯繖浜涘伐浣滅殑鏈濂界殑鏂規硶鏄垱寤轟竴涓畬鎴愭浛鎹㈡搷浣滅殑helper鏂規硶錛岀劧鍚庡湪榪炴帴瀛楃涓插績鏈嶇敤鍏紡琛ㄨ揪涓涓猄QL鍛戒護鏃訛紝浣跨敤鍒涘緩鐨刪elper鏂規硶銆備笌姝ょ被浼肩殑鏄紝鎴戜滑鍙互璁﹉elper鏂規硶鎺ュ彈涓涓狣ate鍨嬬殑鍊鹼紝鐒跺悗璁╁畠杈撳嚭鍩轟簬Oracle鐨則o_date()鍑芥暟鐨勫瓧絎︿覆琛ㄨ揪寮忋?br /><br />銆銆<strong>5銆佸埄鐢≒reparedStatement瀵硅薄鎻愰珮鏁版嵁搴撶殑鎬諱綋鏁堢巼</strong><br /><br />銆銆鍦ㄤ嬌鐢≒reparedStatement瀵硅薄鎵цSQL鍛戒護鏃訛紝鍛戒護琚暟鎹簱榪涜瑙f瀽鍜岀紪璇戯紝鐒跺悗琚斁鍒板懡浠ょ紦鍐插尯銆傜劧鍚庯紝姣忓綋鎵ц鍚屼竴涓狿reparedStatement瀵硅薄鏃訛紝瀹冨氨浼氳鍐嶈В鏋愪竴嬈★紝浣嗕笉浼氳鍐嶆緙栬瘧銆傚湪緙撳啿鍖轟腑鍙互鍙戠幇棰勭紪璇戠殑鍛戒護錛屽茍涓斿彲浠ラ噸鏂頒嬌鐢ㄣ傚湪鏈夊ぇ閲忕敤鎴風殑浼佷笟綰у簲鐢ㄨ蔣浠朵腑錛岀粡甯鎬細閲嶅鎵ц鐩稿悓鐨凷QL鍛戒護錛屼嬌鐢≒reparedStatement瀵硅薄甯︽潵鐨勭紪璇戞鏁扮殑鍑忓皯鑳藉鎻愰珮鏁版嵁搴撶殑鎬諱綋鎬ц兘銆傚鏋滀笉鏄湪瀹㈡埛绔垱寤恒侀澶囥佹墽琛孭reparedStatement浠誨姟闇瑕佺殑鏃墮棿闀夸簬Statement浠誨姟錛屾垜浼氬緩璁湪闄ゅ姩鎬丼QL鍛戒護涔嬪鐨勬墍鏈夋儏鍐典笅浣跨敤PreparedStatement瀵硅薄銆?br /><br />銆銆<strong>6銆佸湪鎴愭壒澶勭悊閲嶅鐨勬彃鍏ユ垨鏇存柊鎿嶄綔涓嬌鐢≒reparedStatement瀵硅薄</strong><br /><br />銆銆濡傛灉鎴愭壒鍦板鐞嗘彃鍏ュ拰鏇存柊鎿嶄綔錛屽氨鑳藉鏄捐憲鍦板噺灝戝畠浠墍闇瑕佺殑鏃墮棿銆侽racle鎻愪緵鐨凷tatement鍜?CallableStatement騫朵笉鐪熸鍦版敮鎸佹壒澶勭悊錛屽彧鏈塒reparedStatement瀵硅薄鎵嶇湡姝e湴鏀寔鎵瑰鐞嗐傛垜浠彲浠ヤ嬌鐢╝ddBatch()鍜宔xecuteBatch()鏂規硶閫夋嫨鏍囧噯鐨凧DBC鎵瑰鐞嗭紝鎴栬呴氳繃鍒╃敤PreparedStatement瀵硅薄鐨剆etExecuteBatch()鏂規硶鍜屾爣鍑嗙殑executeUpdate()鏂規硶閫夋嫨閫熷害鏇村揩鐨凮racle涓撴湁鐨勬柟娉曘傝浣跨敤Oracle涓撴湁鐨勬壒澶勭悊鏈哄埗錛屽彲浠ヤ互濡備笅鎵紺虹殑鏂瑰紡璋冪敤setExecuteBatch()錛?br /></p><p class="code">PreparedStatement pstmt3D null;<br />try {<br />銆((OraclePreparedStatement)pstmt).setExecuteBatch(30);<br />銆...<br />銆pstmt.executeUpdate();<br />}</p><p class="code"><br />銆銆璋冪敤setExecuteBatch()鏃舵寚瀹氱殑鍊兼槸涓涓笂闄愶紝褰撹揪鍒拌鍊兼椂錛屽氨浼氳嚜鍔ㄥ湴寮曞彂SQL鍛戒護鎵ц錛屾爣鍑嗙殑executeUpdate()鏂規硶灝變細琚綔涓烘壒澶勭悊閫佸埌鏁版嵁搴撲腑銆傛垜浠彲浠ラ氳繃璋冪敤PreparedStatement綾葷殑sendBatch()鏂規硶闅忔椂浼犺緭鎵瑰鐞嗕換鍔°?br /><br /><strong>7銆佷嬌鐢∣racle locator鏂規硶鎻掑叆銆佹洿鏂板ぇ瀵硅薄錛圠OB錛?br /><br /></strong>銆銆Oracle鐨凱reparedStatement綾諱笉瀹屽叏鏀寔BLOB鍜孋LOB絳夊ぇ瀵硅薄鐨勫鐞嗭紝灝ゅ叾鏄疶hin椹卞姩紼嬪簭涓嶆敮鎸佸埄鐢≒reparedStatement瀵硅薄鐨剆etObject()鍜宻etBinaryStream()鏂規硶璁劇疆BLOB鐨勫鹼紝涔熶笉鏀寔鍒╃敤setCharacterStream()鏂規硶璁劇疆CLOB鐨勫箋傚彧鏈塴ocator鏈韓涓殑鏂規硶鎵嶈兘澶熶粠鏁版嵁搴撲腑鑾峰彇LOB綾誨瀷鐨勫箋傚彲浠ヤ嬌鐢≒reparedStatement瀵硅薄鎻掑叆鎴栨洿鏂癓OB錛屼絾闇瑕佷嬌鐢╨ocator鎵嶈兘鑾峰彇LOB鐨勫箋傜敱浜庡瓨鍦ㄨ繖浜屼釜闂錛屽洜姝わ紝鎴戝緩璁嬌鐢╨ocator鐨勬柟娉曟潵鎻掑叆銆佹洿鏂版垨鑾峰彇LOB鐨勫箋?br /><br />銆銆<strong>8銆佷嬌鐢⊿QL92璇硶璋冪敤瀛樺偍榪囩▼</strong><br /><br />銆銆鍦ㄨ皟鐢ㄥ瓨鍌ㄨ繃紼嬫椂錛屾垜浠彲浠ヤ嬌鐢⊿QL92鎴朞racle PL/SQL錛岀敱浜庝嬌鐢∣racle PL/SQL騫舵病鏈変粈涔堝疄闄呯殑濂藉錛岃屼笖浼氱粰浠ュ悗緇存姢浣犵殑搴旂敤紼嬪簭鐨勫紑鍙戜漢鍛樺甫鏉ラ夯鐑︼紝鍥犳錛屾垜寤鴻鍦ㄨ皟鐢ㄥ瓨鍌ㄨ繃紼嬫椂浣跨敤SQL92銆?br /><br />銆銆<strong>9銆佷嬌鐢∣bject SQL灝嗗璞℃ā寮忚漿縐誨埌鏁版嵁搴撲腑</strong><br /><br />銆銆鏃㈢劧鍙互灝哋racle鐨勬暟鎹簱浣滀負涓縐嶉潰鍚戝璞$殑鏁版嵁搴撴潵浣跨敤錛屽氨鍙互鑰冭檻灝嗗簲鐢ㄧ▼搴忎腑鐨勯潰鍚戝璞℃ā寮忚漿鍒版暟鎹簱涓傜洰鍓嶇殑鏂規硶鏄垱寤篔ava bean浣滀負浼鐨勬暟鎹簱瀵硅薄錛屽皢瀹冧滑鐨勫睘鎬ф槧灝勫埌鍏崇郴琛ㄤ腑錛岀劧鍚庡湪榪欎簺bean涓坊鍔犳柟娉曘傚敖綆¤繖鏍蜂綔鍦↗ava涓病鏈変粈涔堥棶棰橈紝浣嗙敱浜庢搷浣滈兘鏄湪鏁版嵁搴撲箣澶栬繘琛岀殑錛屽洜姝ゅ叾浠栬闂暟鎹簱鐨勫簲鐢ㄨ蔣浠舵棤娉曞埄鐢ㄥ璞℃ā寮忋傚鏋滃埄鐢∣racle鐨勯潰鍚戝璞$殑鎶鏈紝鍙互閫氳繃鍒涘緩涓涓柊鐨勬暟鎹簱瀵硅薄綾誨瀷鍦ㄦ暟鎹簱涓ā浠垮叾鏁版嵁鍜屾搷浣滐紝鐒跺悗浣跨敤JPublisher絳夊伐鍏風敓鎴愯嚜宸辯殑Java bean綾匯傚鏋滀嬌鐢ㄨ繖縐嶆柟寮忥紝涓嶄絾Java搴旂敤紼嬪簭鍙互浣跨敤搴旂敤杞歡鐨勫璞℃ā寮忥紝鍏朵粬闇瑕佸叡浜綘鐨勫簲鐢ㄤ腑鐨勬暟鎹拰鎿嶄綔鐨勫簲鐢ㄨ蔣浠朵篃鍙互浣跨敤搴旂敤杞歡涓殑瀵硅薄妯″紡銆?br /><br />銆銆<strong>10銆佸埄鐢⊿QL瀹屾垚鏁版嵁搴撳唴鐨勬搷浣?/strong><br /><br />銆銆鎴戣鍚戝ぇ瀹朵粙緇嶇殑鏈閲嶈鐨勭粡楠屾槸鍏呭垎鍒╃敤SQL鐨勯潰鍚戦泦鍚堢殑鏂規硶鏉ヨВ鍐蟲暟鎹簱澶勭悊闇姹傦紝鑰屼笉鏄嬌鐢↗ava絳夎繃紼嬪寲鐨勭紪紼嬭璦銆?br /><br />銆銆濡傛灉緙栫▼浜哄憳瑕佸湪涓涓〃涓煡鎵捐澶氳錛岀粨鏋滀腑鐨勬瘡涓閮戒細鏌ユ壘鍏朵粬琛ㄤ腑鐨勬暟鎹紝鏈鍚庯紝緙栫▼浜哄憳鍒涘緩浜嗙嫭绔嬬殑UPDATE鍛戒護鏉ユ垚鎵瑰湴鏇存柊絎竴涓〃涓殑鏁版嵁銆備笌姝ょ被浼肩殑浠誨姟鍙互閫氳繃鍦╯et瀛愬彞涓嬌鐢ㄥ鍒楀瓙鏌ヨ鑰屽湪涓涓猆PDATE鍛戒護涓畬鎴愩傚綋鑳藉鍦ㄥ崟涓鐨凷QL鍛戒護涓畬鎴愪換鍔★紝浣曞繀瑕佽鏁版嵁鍦ㄧ綉涓婃祦鏉ユ祦鍘葷殑錛熸垜寤鴻鐢ㄦ埛璁ょ湡瀛︿範濡備綍鏈澶ч檺搴﹀湴鍙戞尌SQL鐨勫姛鑳姐?</p><img src ="http://m.tkk7.com/WshmAndLily/aggbug/75242.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/WshmAndLily/" target="_blank">semovy</a> 2006-10-15 11:31 <a href="http://m.tkk7.com/WshmAndLily/articles/75242.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://caoliushequ9.com" target="_blank">亚洲日韩AV一区二区三区四区</a>| <a href="http://xsdjiagu.com" target="_blank">亚洲国产成人久久综合一区77 </a>| <a href="http://kingleadsw.com" target="_blank">91免费精品国自产拍在线不卡</a>| <a href="http://kanzhelu23.com" target="_blank">久久精品一本到99热免费</a>| <a href="http://8953y.com" target="_blank">在线jlzzjlzz免费播放</a>| <a href="http://www132126.com" target="_blank">老司机亚洲精品影院无码</a>| <a href="http://600c28.com" target="_blank">一级特黄录像免费播放中文版</a>| <a href="http://jj5c.com" target="_blank">a视频在线免费观看</a>| <a href="http://btintemet.com" target="_blank">国产网站免费观看</a>| <a href="http://class3g.com" target="_blank">亚洲国产日韩女人aaaaaa毛片在线</a>| <a href="http://mp4888.com" target="_blank">中文字幕在线日亚洲9</a>| <a href="http://ranjihua.com" target="_blank">国产成人精品免费久久久久</a>| <a href="http://av-fantasy.com" target="_blank">jjzz亚洲亚洲女人</a>| <a href="http://dqcjlb.com" target="_blank">亚洲国产精品无码中文lv</a>| <a href="http://yeshenghuowang.com" target="_blank">**aaaaa毛片免费</a>| <a href="http://rushiruhua.com" target="_blank">亚洲色无码一区二区三区</a>| <a href="http://zygwkqf.com" target="_blank">特黄特色大片免费</a>| <a href="http://222xx8.com" target="_blank">好大好硬好爽免费视频</a>| <a href="http://gedebai.com" target="_blank">亚洲色大成网站www永久</a>| <a href="http://517fanfan.com" target="_blank">中出五十路免费视频</a>| <a href="http://se70me.com" target="_blank">亚洲国产精品碰碰</a>| <a href="http://guakao88.com" target="_blank">亚洲AV无码一区二区三区电影</a>| <a href="http://367316.com" target="_blank">a级成人毛片免费视频高清</a>| <a href="http://xuanzhicity.com" target="_blank">亚洲?V乱码久久精品蜜桃 </a>| <a href="http://twtairun.com" target="_blank">四虎在线最新永久免费</a>| <a href="http://www-7607.com" target="_blank">国产l精品国产亚洲区在线观看</a>| <a href="http://57fi.com" target="_blank">亚洲午夜精品国产电影在线观看</a>| <a href="http://gyqcy.com" target="_blank">风间由美在线亚洲一区</a>| <a href="http://kkxzz.com" target="_blank">国产精品视频免费一区二区</a>| <a href="http://dyj696.com" target="_blank">亚洲精品免费观看</a>| <a href="http://mtsp2.com" target="_blank">成人妇女免费播放久久久</a>| <a href="http://nxeea.com" target="_blank">亚洲精品偷拍视频免费观看</a>| <a href="http://gkhnf.com" target="_blank">免费看黄网站在线看</a>| <a href="http://shunfk.com" target="_blank">我要看免费的毛片</a>| <a href="http://www8x5188x.com" target="_blank">亚洲高清视频在线</a>| <a href="http://zhidianzh.com" target="_blank">好先生在线观看免费播放</a>| <a href="http://okgou58.com" target="_blank">www.亚洲日本</a>| <a href="http://xxxxnii.com" target="_blank">免费福利网站在线观看</a>| <a href="http://wwwseselu.com" target="_blank">亚洲乱码在线视频</a>| <a href="http://xy996688.com" target="_blank">在线看片v免费观看视频777</a>| <a href="http://youtobey.com" target="_blank">亚洲男人的天堂在线</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>