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

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

?? occilbar.cpp

?? occi在oralce10G中的兩個(gè)例子
?? CPP
字號(hào):
/* Copyright (c) 2004, Oracle. All rights reserved.  *//*   NAME     occilbar.cpp - OCCI Support for reading/writing arrays of LOB's.  DESCRIPTION     To exhibit OCCI Support for reading/writing arrays of LOB's.     Create a table with BLOB, CLOB column.     Populate the values in the table by using new LOB Array Write method     Retrieve the values from the table by using the LOB Array Read method          1. readVectorOfBlobs()     2. readVectorOfClobs()     3. writeVectorOfBlobs()     4. writeVectorOfClobs()     MODIFIED   (MM/DD/YY)   kukannan    09/21/04  - Include iostream    sudsrini    07/22/04  - Copyright Info   debanerj    06/04/04  - debanerj_13064_lob_array_read   kukannan    05/26/04  - Creation*/#include <stdlib.h>#include <occi.h>#include <iostream>using namespace oracle::occi;using namespace std;#define NO_OF_LOBS 10class lobarray {  private:  Environment *env;  Connection *conn;  public:  lobarray (string user, string passwd, string db)  {    env = Environment::createEnvironment (Environment::DEFAULT);    conn = env->createConnection (user, passwd, db);  }  /**   * Destructor for the lobarray test case.   */  ~lobarray ()  {    env->terminateConnection (conn);    Environment::terminateEnvironment (env);  }  // end of ~lobarray ()  /**   * Creating schema objects.   */  dvoid createTables ()  {    string sqlstr1 = "CREATE TABLE lobarray_tab";    sqlstr1 += " (c1 NUMBER,  c2 BLOB, c3 CLOB)";    Statement *stmt = conn->createStatement(sqlstr1);    stmt->execute();  }  // end of createTables ()  /**   * Removing schema objects created.   */  dvoid dropTable ()  {    Statement *stmt= conn->createStatement("DROP TABLE lobarray_tab");    stmt->execute();  }  // end of cleanup ()  /**  * The testing logic of the test case.  */  dvoid test ()  {    cout << "lobarray - Testing the OCCI Array LOB Api's"  << endl;    createTables ();    Statement *stmt = conn->createStatement("");    char stmt_str[500];    for (int i=0; i<NO_OF_LOBS; i++)    {      sprintf(stmt_str, "INSERT INTO lobarray_tab VALUES \      (%d, empty_blob(), empty_clob())", i);      stmt->execute ((const char *)stmt_str);    }    conn->terminateStatement (stmt);     writeArrayBlob ();    readArrayBlob ();    cout << "Writing into clob by mentioning character amts " << endl;     writeArrayClob (1);    cout << "Reading from clob by mentioning character amts " << endl;     readArrayClob (1);    cout << "Writing into clob by mentioning byte amts " << endl;     writeArrayClob (2);    cout << "Reading from clob by mentioning byte amts " << endl;     readArrayClob (2);      dropTable ();    cout << "lobarray - done" << endl;  } // end of test()        /************************************************************/        /*                  writeArrayBlob()                        */        /************************************************************/        /*Select all the Lob Locators from Blob col from the table. */        /*Push these Lob Locators in a Vector of Blobs.             */        /*Call populate_buffer function which would populate the    */        /*amount of data to be written, sets the offsets, populates */        /*the buffer.                                               */        /*Call writeVectorOfBlobs with the populate buffer,amount   */        /*and offset value. This would write the buffered values    */        /*into respective lobs. Do and connection commit and release*/        /*the allocated memory.                                     */        /************************************************************/  void writeArrayBlob ()  {    cout << "Writing Array Lob using writeVectorofBlobs" << endl;    char stmt_str[500];     vector<Blob> lob_vec;    sprintf(stmt_str,"Select c2 from lobarray_tab for update");    Statement *stmt = conn->createStatement((const char *)stmt_str);    ResultSet *rs = stmt->executeQuery();      while (rs->next())        lob_vec.push_back(rs->getBlob(1));      stmt->closeResultSet(rs);    conn->terminateStatement(stmt);    oraub8 byte_amts[NO_OF_LOBS];    oraub8 offsets[NO_OF_LOBS];    unsigned char *buffers[NO_OF_LOBS];    oraub8 buffer_lens[NO_OF_LOBS];    populate_buffer(byte_amts,offsets, buffers,buffer_lens,1);    writeVectorOfBlobs(conn,lob_vec,byte_amts,offsets,buffers,buffer_lens);    conn->commit();    release_memory(buffers);    cout << "Writing - Done" << endl;  }        /************************************************************/        /*                  writeArrayClob()                        */        /************************************************************/        /*Select all the Lob Locators from Clob col from the table. */        /*Push these Lob Locators in a Vector of Clobs.             */        /*Call populate_buffer function which would populate the    */        /*amount of data to be written, sets the offsets, populates */        /*the buffer.                                               */        /*Call writeVectorOfClobs with the populated buffer,amount  */        /*and offset value. This would write the buffered values    */        /*into respective lobs. Do and connection commit and release*/        /*the allocated memory.                                     */        /*The type variable differentiates the attributes based on  */        /*which the value gets inserted into the Clob.              */        /*A value of 1 for the TYPE variable means that the <amts>  */        /*of CHARACTER gets inserted into the Lobs.                 */        /*A value of 2 for the TYPE variable means that the <amts>  */        /*of BYTES gets inserted into the Lobs.                     */        /************************************************************/  void writeArrayClob (int type)  {    char stmt_str[500];     vector<Clob> lob_vec;    sprintf(stmt_str,"Select c3 from lobarray_tab for update");    Statement *stmt = conn->createStatement((const char *)stmt_str);    ResultSet *rs = stmt->executeQuery();      // Got all the loblocator and pushed in to the vector     while (rs->next())        lob_vec.push_back(rs->getClob(1));      stmt->closeResultSet(rs);    conn->terminateStatement(stmt);    oraub8 amts[NO_OF_LOBS];    oraub8 offsets[NO_OF_LOBS];    unsigned char *buffers[NO_OF_LOBS];    oraub8 buffer_lens[NO_OF_LOBS];    populate_buffer(amts,offsets, buffers,buffer_lens,1);            /**************************************************************/        /*Populating the Lob by passing Character amounts if type = 1 */        /*Populating the Lob by passing Byte amounts if type = 2      */        /**************************************************************/    if (type==1)    {      writeVectorOfClobs(conn,lob_vec,NULL,amts,offsets,\      buffers,buffer_lens);    }    else    {      writeVectorOfClobs(conn,lob_vec,amts,NULL,offsets,\      buffers,buffer_lens);   }    conn->commit();    release_memory(buffers);    cout << "Writing - Done" << endl;  }        /************************************************************/        /*                  readArrayBlob()                         */        /************************************************************/        /*Select all the Lob Locators from Blob col from the table. */        /*Push these Lob Locators in a Vector of Blobs.             */        /*Call populate_buffer function which would assign the      */        /*the offsets, allocate memory for the buffer for           */        /*readVectorOfBlobs to read the value into.                 */        /*Call readVectorOfBlobs with the populated amount and      */        /*offset value. This would read the LOB data into the       */        /*allocated buffers.  Print the buffers by calling          */        /*print_buffers() and release the allocated memory.         */         /************************************************************/  void readArrayBlob ()  {    cout << "Reading Array Lob using readVectorofBlob" << endl;    char stmt_str[500];     vector<Blob> lob_vec;    sprintf(stmt_str,"Select c2 from lobarray_tab order by c1");    Statement *stmt = conn->createStatement((const char *)stmt_str);    ResultSet *rs = stmt->executeQuery();      while (rs->next())        lob_vec.push_back(rs->getBlob(1));      stmt->closeResultSet(rs);    conn->terminateStatement(stmt);    oraub8 read_amts[NO_OF_LOBS];    oraub8 offsets[NO_OF_LOBS];    unsigned char *buffers[NO_OF_LOBS];    oraub8 buffer_lens[NO_OF_LOBS];    populate_buffer(read_amts,offsets, buffers,buffer_lens,0);        readVectorOfBlobs(conn,lob_vec,read_amts,offsets,buffers,buffer_lens);        print_buffer(buffers,read_amts);    release_memory(buffers);    cout << "Reading - Done " << endl;  }        /************************************************************/        /*                  readArrayClob()                         */        /************************************************************/        /*Select all the Lob Locators from Clob col from the table. */        /*Push these Lob Locators in a Vector of Clobs.             */        /*Call populate_buffer function which would assign the      */        /*the offsets, allocate memory for the buffer for           */        /*readVectorOfClobs to read the value into.                 */        /*Call readVectorOfClobs with the populated amount and      */        /*offset value. This would read the LOB data into the       */        /*allocated buffers.Print the buffers by calling            */        /*print_buffers() and release the allocated memory.         */         /*A value of 1 for the TYPE variable means that the <amts>  */        /*of CHARACTER gets inserted into the Lobs.                 */        /*A value of 2 for the TYPE variable means that the <amts>  */        /*of BYTES gets inserted into the Lobs.                     */        /************************************************************/  void readArrayClob (int type)  {    char stmt_str[500];     vector<Clob> lob_vec;    sprintf(stmt_str,"Select c3 from lobarray_tab order by c1");    Statement *stmt = conn->createStatement((const char *)stmt_str);    ResultSet *rs = stmt->executeQuery();      while (rs->next())        lob_vec.push_back(rs->getClob(1));      stmt->closeResultSet(rs);    conn->terminateStatement(stmt);    oraub8 read_amts[NO_OF_LOBS];    oraub8 offsets[NO_OF_LOBS];    unsigned char *buffers[NO_OF_LOBS];    oraub8 buffer_lens[NO_OF_LOBS];    populate_buffer(read_amts,offsets,buffers,buffer_lens,0);        if (type==1)      readVectorOfClobs(conn,lob_vec,NULL,read_amts,offsets,\      buffers,buffer_lens);    else if (type==2)      readVectorOfClobs(conn,lob_vec,read_amts,NULL,offsets,\      buffers,buffer_lens);    print_buffer(buffers,read_amts);    release_memory(buffers);    cout << "Reading - Done " << endl;  }        /************************************************************/        /*                  populate_buffer()                       */        /************************************************************/        /*This function assign the offsets,buffer_lens,buffer_amts  */        /*for each Lob.Allocates memory for each buffer and populate*/        /*buffer for each Lob. The significance of Idx is to        */        /*differentiate the calls made while reading or writing the */        /*Lob Data. Reading/Writing Lobs require offset,amts and    */        /*buffer_lens for each Lob.                                 */        /*Idx=1 means the function is called prior to writing into  */        /*the LOB and populates the buffer                          */        /*Idx=1 means the function is called prior to reading from  */        /*the LOB and donot populate the buffer                     */        /************************************************************/  void populate_buffer(oraub8 *amts,oraub8 *offsets,unsigned char **buffers,\  oraub8 *buffer_lens,int idx)  {      for (int i=0; i < NO_OF_LOBS ; i++)      {        offsets[i]=1;         buffer_lens[i]=i+1; //Writing upto multiples of 5         amts[i]=buffer_lens[i];        buffers[i]=new unsigned char[buffer_lens[i]];        if (idx!=0)        {           for (int j=0; j<buffer_lens[i]; j++)           {              buffers[i][j] = (unsigned char)(65);           }        }      }  }        /************************************************************/        /*                  print_buffer()                          */        /************************************************************/        /*This function prints character by character (byte_amts)   */        /*of the buffer which is passed                             */        /************************************************************/  void print_buffer(unsigned  char **buffers, oraub8 *byte_amts)  {    for (int i=0; i<NO_OF_LOBS;i++)    {      cout << "Number of Bytes read " << (ub4) byte_amts[i] << endl;      cout << "[" ;      for (int j=0; j< byte_amts[i];j++)        cout <<  buffers[i][j]  ;      cout <<"]" << endl;    }  }        /************************************************************/        /*                  release_memory()                        */        /************************************************************/        /*This function releases the memory of the buffers which get*/        /*allocated by the populate_buffer function calls           */        /************************************************************/  void release_memory(unsigned char **buffer)  {    for (int i=0;i<NO_OF_LOBS;i++)      delete [] buffer[i];  }}; // end of class lobarray /** * The main function where the test case is instantiated */int main ( int argc, char* argv[]){  string userName  = "HR";  string password  = "HR";  string database  = "";  lobarray* h = new lobarray (userName,password,database);  try   {    h->test ();  }  catch (SQLException ea)   {     cout<<"Exception thrown by test Function" <<endl;     cout<<"Error number: "<<  ea.getErrorCode() << endl;     cout<<ea.getMessage() << endl;  }  delete (h);  return 0;}// end of main (int, char*)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品高清视频在线观看| 欧美亚洲丝袜传媒另类| 99视频精品在线| 色婷婷综合久久久久中文一区二区| 欧美性大战久久| 日韩精品一区二区三区视频 | 亚洲精品成人悠悠色影视| 午夜在线电影亚洲一区| 国产资源在线一区| 一本久久a久久免费精品不卡| 日韩一区二区精品| 中文字幕一区二区三区在线播放| 午夜电影网亚洲视频| 激情五月婷婷综合| 色婷婷久久久综合中文字幕| 欧美sm美女调教| 日韩美女啊v在线免费观看| 婷婷中文字幕一区三区| 日本va欧美va瓶| 激情偷乱视频一区二区三区| 国产一区二区精品久久| 色综合久久中文综合久久97 | 国产精品久久久久影院色老大| 亚洲成人先锋电影| 成人免费视频免费观看| 欧美高清性hdvideosex| 中文字幕日韩一区二区| 另类小说综合欧美亚洲| 在线观看亚洲成人| 国产欧美日韩另类一区| 日本成人在线视频网站| 91视频国产资源| 久久色在线视频| 丝袜a∨在线一区二区三区不卡| heyzo一本久久综合| 日韩一级精品视频在线观看| 亚洲精品国产成人久久av盗摄| 欧美日韩美少妇| 亚洲人成精品久久久久久 | 亚洲成人精品一区| 国产激情一区二区三区| 欧美日韩国产高清一区| 国产精品国产三级国产普通话蜜臀| 日韩电影在线看| 色嗨嗨av一区二区三区| 国产农村妇女毛片精品久久麻豆 | 日韩欧美第一区| 亚洲一区二区av在线| 大美女一区二区三区| 精品久久久久av影院| 午夜精品爽啪视频| 91色视频在线| 国产精品国产三级国产aⅴ无密码| 久久91精品久久久久久秒播 | 精品影院一区二区久久久| 欧美区在线观看| 亚洲国产一区二区三区青草影视| av在线播放不卡| 国产人成一区二区三区影院| 国产一区视频导航| 精品卡一卡二卡三卡四在线| 另类小说一区二区三区| 91精品视频网| 欧美一级免费大片| 一区精品在线播放| 精品免费一区二区三区| 亚洲成人av在线电影| 在线观看一区日韩| 亚洲精品精品亚洲| 色哟哟精品一区| 亚洲欧美一区二区不卡| 99久久婷婷国产| 国产精品久久影院| 91网上在线视频| 亚洲精品视频免费看| 色综合久久久久综合99| 亚洲乱码国产乱码精品精98午夜 | 日韩欧美一区中文| 免费高清不卡av| 欧美成人精品福利| 日韩av在线免费观看不卡| 欧美一区二区三区系列电影| 毛片av中文字幕一区二区| 精品噜噜噜噜久久久久久久久试看| 精品无码三级在线观看视频 | 成人综合在线观看| 亚洲欧美综合另类在线卡通| 91视频.com| 亚洲成va人在线观看| 911国产精品| 精品亚洲成av人在线观看| 久久免费电影网| 99久久夜色精品国产网站| 亚洲最大成人网4388xx| 91精品一区二区三区在线观看| 久久se这里有精品| 亚洲国产电影在线观看| 91免费小视频| 日产欧产美韩系列久久99| 欧美精品一区二| 99久久精品免费看| 亚洲成人av在线电影| 亚洲精品在线免费播放| 成人va在线观看| 亚洲国产乱码最新视频| 欧美成人官网二区| 成人福利在线看| 亚洲成人7777| 久久久影院官网| 一本一道久久a久久精品 | 欧美一级高清片| 国产成a人无v码亚洲福利| 亚洲精品欧美在线| 91精品国产欧美一区二区成人 | 欧美国产日韩一二三区| 欧美午夜片在线观看| 激情综合色丁香一区二区| 国产精品久久久久久久岛一牛影视| 91黄色激情网站| 精品一区二区久久| 亚洲美腿欧美偷拍| 欧美成人性战久久| 在线亚洲+欧美+日本专区| 韩国成人精品a∨在线观看| 亚洲男人的天堂在线aⅴ视频| 日韩一区国产二区欧美三区| 99热精品一区二区| 免费在线观看精品| 亚洲免费观看高清完整版在线| 日韩免费高清视频| 亚洲欧美偷拍另类a∨色屁股| 91精品在线观看入口| 94-欧美-setu| 看片网站欧美日韩| 亚洲精品欧美专区| 久久精品人人做人人综合| 欧美三级电影一区| 成人精品视频一区二区三区尤物| 午夜视频久久久久久| 国产精品日韩精品欧美在线| 日韩三级电影网址| 91福利在线导航| 国产真实精品久久二三区| 亚洲福利视频一区二区| 中文字幕一区二区在线播放| 精品国产1区二区| 欧美另类变人与禽xxxxx| 99精品国产视频| 国产一区二区0| 免费观看成人av| 亚洲一区二区中文在线| 亚洲欧洲一区二区在线播放| 久久精品在线观看| 日韩三级电影网址| 884aa四虎影成人精品一区| 91美女在线看| 波多野结衣视频一区| 国产精品一区二区免费不卡| 麻豆精品国产91久久久久久| 丝袜美腿亚洲综合| 亚洲一区二区三区四区中文字幕 | 色偷偷久久一区二区三区| 国产精品亚洲综合一区在线观看| 日本不卡一二三| 亚洲成人免费影院| 一区二区三区毛片| 日韩美女视频一区| 亚洲天堂久久久久久久| 欧美激情一区二区在线| 久久美女高清视频| 亚洲精品一区二区三区在线观看 | 青青草视频一区| 亚洲成人动漫精品| 亚洲成av人片在线| 午夜激情综合网| 午夜国产精品影院在线观看| 亚洲综合色噜噜狠狠| 亚洲一区二区三区在线看| 一区二区三区日韩在线观看| 亚洲精品成人少妇| 夜夜揉揉日日人人青青一国产精品| 亚洲欧美韩国综合色| 亚洲另类在线制服丝袜| 亚洲精品欧美激情| 亚洲一区中文在线| 五月综合激情网| 日本视频一区二区三区| 免费人成网站在线观看欧美高清| 99国产精品国产精品久久| 粉嫩av一区二区三区在线播放 | 欧美xxxx老人做受| 日韩精品在线一区二区| 欧美成人精品二区三区99精品| 精品美女一区二区| 久久久精品2019中文字幕之3| 国产亚洲精品超碰| 国产精品乱码一区二三区小蝌蚪| 国产精品久久久爽爽爽麻豆色哟哟 | 26uuu国产日韩综合| 久久亚洲精华国产精华液 |