Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

Similar documents
10.ppt

歯JavaExceptionHandling.PDF

쉽게 풀어쓴 C 프로그래밊

FileMaker ODBC and JDBC Guide

FileMaker ODBC and JDBC Guide

자바-11장N'1-502

FileMaker ODBC 및 JDBC 가이드

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

FileMaker 15 ODBC 및 JDBC 설명서

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

rmi_박준용_final.PDF

02 C h a p t e r Java

Interstage5 SOAP서비스 설정 가이드

Analyze Connection Failover Options.ppt

J2EE Concepts

JMF2_심빈구.PDF

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

Microsoft PowerPoint - GUI _DB연동.ppt [호환 모드]

개발문서 Oracle - Clob

PowerPoint 프레젠테이션

- 다음은 Statement 객체를사용해서삽입 (insert) 작업의예 String sql = "insert into member(code, name, id, pwd, age) values ("; int id = 10; sql = sql + id +, ;// 항목사이에

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (

Microsoft PowerPoint - 18-DataSource.ppt

13주-14주proc.PDF

개요오라클과티베로에서 JDBC 를통해접속한세션을구분할수있도록 JDBC 접속시 ConnectionProperties 를통해구분자를넣어줄수있다. 하나의 Node 에다수의 WAS 가있을경우 DB 에서 Session Kill 등의동작수행시원하는 Session 을선택할수있다.

USB USB DV25 DV25 REC SRN-475S REC SRN-475S LAN POWER LAN POWER Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl C

목차 BUG DEQUEUE 의 WAIT TIME 이 1 초미만인경우, 설정한시간만큼대기하지않는문제가있습니다... 3 BUG [qp-select-pvo] group by 표현식에있는컬럼을참조하는집합연산이존재하지않으면결괏값오류가발생할수있습니다... 4

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

untitled

NoSQL

Microsoft PowerPoint - aj-lecture5.ppt [호환 모드]

<4D F736F F F696E74202D20C1A63234C0E520C0D4C3E2B7C228B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

Microsoft PowerPoint - 04-UDP Programming.ppt

12-file.key

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]

[ 목차 ] 5.1 데이터베이스프로그래밍개념 5.2 T-SQL T-SQL 문법 5.3 JAVA 프로그래밍 2

untitled

교육2 ? 그림

IBM blue-and-white template

Java

Microsoft PowerPoint - 03-TCP Programming.ppt

chapter4

Spring Boot/JDBC JdbcTemplate/CRUD 예제

91 // 물리적으로닫지않고 cache에반환만한다. opstmt.close(); } opstmt.setint(3, lowerlimit); opstmt.setint(4, upperlimit); // Execute query rset = opstmt.executequery

PowerPoint 프레젠테이션

MasoJava4_Dongbin.PDF

PowerPoint 프레젠테이션

단계

thesis

Chap7.PDF

untitled

07 자바의 다양한 클래스.key

untitled

03-JAVA Syntax(2).PDF

JavaGeneralProgramming.PDF

비긴쿡-자바 00앞부속

8 장데이터베이스 8.1 기본개념 - 데이터베이스 : 데이터를조직적으로구조화한집합 (cf. 엑셀파일 ) - 테이블 : 데이터의기록형식 (cf. 엑셀시트의첫줄 ) - 필드 : 같은종류의데이터 (cf. 엑셀시트의각칸 ) - 레코드 : 데이터내용 (cf. 엑셀시트의한줄 )

DocsPin_Korean.pages

13-Java Network Programming

뇌를 자극하는 JSP & Servlet 슬라이드

웹연동 } 웹 (Web) 환경에서데이터베이스시스템을연동하는방법은다음과같다 } Server Client 구조의통신 (2-Tier) } Server Middleware Client 구조의통신 (3-Tier) 2

교육자료

PowerPoint 프레젠테이션

Cluster management software

Application 에서 Parameter 값을받아 JDBC Interface 로보내게되면적절한 JDBC Driver 를통해 SQL 을 Database 로보내주게되고결과를받아서사용자에게보여주게된다. 2-2 JDBC Interface JDBC 의핵심 Interface

웹의 뼈대, HTML

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

Simplify your Job Automatic Storage Management DB TSC

Chap12

ALTIBASE 사용자가이드 Templete

MySQL-Ch10

17장

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

[ 정보 ] 과학고 R&E 결과보고서 Monte Carlo Method 를이용한 고교배정시뮬레이션 연구기간 : ~ 연구책임자 : 강대욱 ( 전남대전자컴퓨터공학부 ) 지도교사 : 최미경 ( 전남과학고정보 컴퓨터과 ) 참여학생 : 박진명 ( 전

페이지 2 / 9 목차 개요웹취약점분류점검결과해결방안 주의사항 : 빛스캔 ( 주 ) 의취약성검사가대상웹사이트의취약점을 100% 진단하지못할가능성이있으며, 원격에서탐지 하는점검의특성상오탐지 (False Positive) 할가능성이있으므로충분한검토과정

1

1217 WebTrafMon II

Microsoft PowerPoint - Tech-iSeminar_9iAS_OAS10g_PBT.ppt

MySQL-Ch05

05-class.key

PRO1_09E [읽기 전용]

PowerPoint Presentation

<4D F736F F F696E74202D20C1A63235C0E520B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

歯sql_tuning2

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

자바 프로그래밍

슬라이드 1

Sena Device Server Serial/IP TM Version

uFOCS

Data Sync Manager(DSM) Example Guide Data Sync Manager (DSM) Example Guide DSM Copyright 2003 Ari System, Inc. All Rights reserved. Data Sync Manager

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

강의 개요

ALTIBASE HDB Patch Notes

The Self-Managing Database : Automatic Health Monitoring and Alerting

Microsoft PowerPoint - Java7.pptx

PowerPoint 프레젠테이션

14-Servlet

Transcription:

135-080 679-4 13 02-3430-1200

1 2 11 2 12 2 2 8 21 Connection 8 22 UniSQLConnection 8 23 8 24 / / 9 3 UniSQL 11 31 OID 11 311 11 312 14 313 16 314 17 32 SET 19 321 20 322 23 323 24 33 GLO 26 331 GLO 26 332 GLO 27 1

1 JDBC UniSQL DBMS( UniSQL) JDBC API UniSQL JDBC UniSQL UniSQL 11 UniSQL JDBC 111 JDBC 10 UniSQL/X Realese 41 UniCAS 41 JDK 12 112 JDBC 20 UniSQL/X Realese 43 UniCAS 42 JDK 12 12 UniSQL JDBC UniCAS CLASSPATH UniCAS UniSQL Pooling UniSQL JDBC UniCAS 121 UniCAS UniCAS Easy-Manager Terminal 1211 Easy-Manager UniCAS JDBC UniCAS 1 CAS Type ON, 2 CAS Type 2

Application Server Easy-Manager CAS Type 1 EasyManager 2 EasyManager Application Server Broker Level Broker Add 1 ~ 3 3 3

1 4 Broker Add Step1 Broker Name : Broker AS Type : CAS APPL_ROOT : CAS AS Minimum : AS Maximum : Broker Port : JDBC Connection Description : 4

2 5 Broker Add Step2 Advanced option : 1 Description : 3 6 Broker Add Step3 Report : 5

1211 Terminal UniCAS UniCAS monitor ( 7 ) JDBC CAS type broker, CAS broker Application Server Terninal CAS type 7 broker and current job information CAS $UNICAS/conf/unicasconf broker ( 8 ) broker SERVICE ON, Application Server 1 MIN_NUM_APPL_SERVER 1 6

8 specify the parameters of unicasconf file UniCAS Installation Guide 5~13 122 CLASSPATH CLASSPATH UniSQL JDBC ( UniCAS Installation Guide 17~18 ) Ex) csh - setenv CLASSPATH ${CLASSPATH:${HOME/jdbc/unisqljdbc202jar 7

2 UniSQL SQL UniSQL RDBMS JDBC UniSQL Connection 21 Connection Connection Connection DriverManagergetConnection( jdbc : unisql : IP : PORT :::, ID, PASSWORD ); IP : IP PORT : UniCAS Type ID : DBA PUBLIC 2 ID PUBLIC PASSWORD : PASSWORD 22 UniSQLConnection UniSQL JDBC Connection UniSQLConnection GLO getnewinstance API UniSQLConnection UniSQLConnection (UniSQLConnection)DriverManagergetConnection( jdbc:unisql:ip : PORT :::, ID, PASSWORD ); 23 RDBMS import javasql*; public class selectdata { public static void main(string[] args) throws Exception { 8

Connection null; Statement stmt = null; ResultSet rs = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); // 1 DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // 2 String sql = "select name, country, cost, checkout_time, number_of_restaurants from hotel"; stmt = conncreatestatement(); rs = stmtexecutequery(sql); while(rsnext()) { String name = rsgetstring("name"); String country = rsgetstring("country"); String cost = rsgetstring("cost"); String checkout_time = rsgetstring("checkout_time"); String number_of_restaurants = rsgetstring("number_of_restaurants"); Systemoutprintln("name ==> " + name); Systemoutprintln("country ==> " + country); Systemoutprintln("cost ==> " + cost); Systemoutprintln("checkout_time ==> " + checkout_time); Systemoutprintln("number_of_restaurants ==> " + number_of_restaurants); Systemoutprintln("\n=========================================\n"); rsclose(); stmtclose(); connclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); 1 : UniSQL JDBC 2 : Connection sample ID PUBLIC user Connection user 2 : Connection 43300 24 / /,, RDBMS 9

import javasql*; public class insertdata { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // connection autocommit (default autocommit ) connsetautocommit(false); // 1 String sql = "insert into test_class(cur_date) values (SYS_DATE)"; stmt = conncreatestatement(); stmtexecuteupdate(sql); Systemoutprintln(" "); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); 1 : true autocommit false (3212 ) 10

3 UniSQL 31 OID JDBC OID OID, OID DB user_info class car attribute car class, composition CREATE CLASS car ( name char(40), spec string, color char(20) ) CREATE CLASS user_info ( name char(20), addr string, car car ) 311 OID Connection OID string UniSQLOID 3111 OID attribute OID user_info car OID OID name, spec, color import javasql*; import unisqlsql*; // 1 public class selectoid2 { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; ResultSet rs = null; ResultSet urs = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); 11

connsetautocommit(false); // 2 // car attribute select // OID String sql = "select name, addr, car from user_info"; stmt = conncreatestatement(); rs = stmtexecutequery(sql); // OID attribute array String [] attr = {"name", "spec", "color"; // 3 while(rsnext()) { String user_name = rsgetstring("name"); String user_addr = rsgetstring("addr"); // select OID UniSQLOID UniSQLOID user_car = (UniSQLOID)rsgetObject("car"); // 4 // OID attribute // array, ResultSet urs = user_cargetvalues(attr); // 5 ursnext(); String car_name = ursgetstring("name"); String car_spec = ursgetstring("spec"); String car_color = ursgetstring("color"); Systemoutprintln(" : " + user_name); Systemoutprintln(" : " + user_addr); Systemoutprintln(" : " + car_name); Systemoutprintln(" : " + car_spec); Systemoutprintln(" : " + car_color); Systemoutprintln("\n==================================================\n"); ursclose(); rsclose(); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); user user 1 : OID unisqlsql* import 12

2 : ResultSet close() ResultSet ResultSet autocommit close() ResultSet autocommit false 3 : attr OID attribute array 4 : user_info class, user OID OID UniSQLOID getobject 5 : getobject OID API getvalues ResultSet getvalues(attr) : attr String array attribute attribute null attribute (ex getvalues(null) 3212 ) 3112 String OID String, OID String String OID UniSQLOID import javasql*; import unisqlsql*; import unisqljdbcdriver*; // 1 public class selectoid3 { public static void main(string[] args) throws Exception { UniSQLConnection null; ResultSet urs = null; // OID String String Car_OID_S = "@320 8 0"; // 2 ClassforName("unisqljdbcdriverUniSQLDriver"); (UniSQLConnection)DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","", ""); // 3 // OID string UniSQLOID UniSQLOID Car_OID = UniSQLOIDgetNewInstance(conn, Car_OID_S); String [] attr = {"name", "spec", "color"; // 4 // OID ResultSet urs = Car_OIDgetValues(attr); ursnext(); String name = ursgetstring("name"); 13

String spec = ursgetstring("spec"); String color = ursgetstring("color"); Systemoutprintln("car_name ==> " + name); Systemoutprintln("car_spec ==> " + spec); Systemoutprintln("car_color ==> " + color); Systemoutprintln("\n=========================================\n"); ursclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); (servlet, JSP ) OID hidden OID string UniSQLOID 2 : OID string OID Car_OID_S ( ) 4 : string OID UniSQLOID getnewinstance 3 : getnewinstance connection, connection UniSQLConnection 1 : UniSQLConnection unisqljdbcdriver* import 312 OID OID OID OID 3121 OID car, OID user_info user import javasql*; import unisqlsql*; import unisqljdbcdriver*; // 1 public class insertoid { 14

public static void main(string[] args) throws Exception { Connection null; UniSQLStatement ustmt = null; UniSQLPreparedStatement upstmt = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); connsetautocommit(false); String sql = "insert into car values (' ','2000 cc',' ')"; // executeinsert UniSQLStatement ustmt = (UniSQLStatement)conncreateStatement(); // 2 // executeinsert insert insert insert instance OID UniSQLOID car_oid = ustmtexecuteinsert(sql); // 3 Systemoutprintln(" "); // OID class UniSQLPreparedStatement // //? OID sql = "insert into user_info(name, addr, car) values (' ', ' ',?)"; upstmt = (UniSQLPreparedStatement)connprepareStatement(sql); upstmtsetoid(1,car_oid); // 6 upstmtexecuteupdate(); Systemoutprintln("user "); ustmtclose(); upstmtclose(); conncommit(); // 5 // 4 catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); class, OID class car class, OID user_info class user OID 3 : car class OID executeinsert executeinsert insert, OID 15

2 : executeinsert Statement UniSQLStatement, unisqljdbcdriver* import ( 1 ) 4 : OID user_info class UniSQLPreparedStatement ( 5 ) OID? setoid ( 6 ) UniSQLPreparedStatement unisqljdbcdriver* import ( 1 ) 313 RDBMS UniSQL OID 3131 OID user_info class car OID OID car class import javasql*; import unisqlsql*; import unisqljdbcdriver*; public class deleteoid { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; ResultSet rs = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); String sql = "select car from user_info where name = ' '"; stmt = conncreatestatement(); rs = stmtexecutequery(sql); rsnext(); // OID UniSQLOID user_car = (UniSQLOID)rsgetObject("car"); // OID OID user_carremove(); // 1 Systemoutprintln(" "); rsclose(); stmtclose(); conncommit(); 16

catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); user car OID OID 1 : remove() car user_info class car attribute null ( ) 314 OID OID 2 JDBC API 3141 UPDATE OBJECT UPDATE OBJECT OID import javasql*; import unisqlsql*; import unisqljdbcdriver*; public class updateoid { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; UniSQLPreparedStatement upstmt = null; ResultSet rs = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); connsetautocommit(false); String sql = "select car from user_info where name = ' '"; 17

stmt = conncreatestatement(); rs = stmtexecutequery(sql); UniSQLOID user_car = null; // ' OID rsnext(); user_car = (UniSQLOID)rsgetObject("car"); // OID UPDATE sql = "update object? set name = 'SM5', spec ='2000cc, ABS, DUAL AIRBAG', color = ' '"; // 1 upstmt = (UniSQLPreparedStatement)connprepareStatement(sql); upstmtsetoid(1,user_car); upstmtexecuteupdate(); // 2 rsclose(); upstmtclose(); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); 1 : OID update object OID 2 : update object OID 3121 UniSQLPreparedStatement 3142 OID import javasql*; import unisqlsql*; 3141 UniSQL JDBC API public class updateoid2 { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; ResultSet rs = null; 18

// UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // ' OID String sql = "select car from user_info where name = ' '"; stmt = conncreatestatement(); rs = stmtexecutequery(sql); UniSQLOID user_car = null; rsnext(); user_car = (UniSQLOID)rsgetObject("car"); // OID UPDATE String [] attr = { "name", "spec", "color"; // 1 Object [] val = { "SM525V", "2500cc LSD ABS", " "; // 2 user_carsetvalues(attr, val); rsclose(); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); // 3 3141 1 : update attribute array 2 : attr array array 3 : setvalues 32 SET JDBC SET SET DB user_info2 class car attribute car2 class car2 class spec attribute string CREATE CLASS car2 ( name char(40), spec set_of(string) ) CREATE CLASS user_info2 ( 19

name char(20), addr string, car set_of(car2) ) 321 SET derived table Collection SET 3211 derived table SET import javasql*; derived table SET public class selectset1 { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; ResultSet rs = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // SET derived table String sql = "select name, addr, car2name from user_info2, table(car) as t(car2)"; stmt = conncreatestatement(); rs = stmtexecutequery(sql); while(rsnext()) { String user_name = rsgetstring("name"); String user_addr = rsgetstring("addr"); String car_name = rsgetstring("car2name"); Systemoutprintln(" : " + user_name); Systemoutprintln(" : " + user_addr); Systemoutprintln(" : " + car_name); Systemoutprintln("\n================================\n"); rsclose(); stmtclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); // 1 20

derived table SET car attribute derived table 1 : car attribute t derived table car2 attribute (3212 ) SM5 XG 3212 Collection SET Collection 3211 SET 3211 import javasql*; import unisqljdbcdriver*; import unisqlsql*; public class selectset2 { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; UniSQLResultSet rs = null; UniSQLResultSet urs = null; ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); connsetautocommit(false); // 1 String sql = "select name, addr, car from user_info2"; stmt = conncreatestatement(); rs = (UniSQLResultSet)stmtexecuteQuery(sql); while(rsnext()) { String user_name = rsgetstring("name"); String user_addr = rsgetstring("addr"); // SET getcollection // OID SET UniSQLOID array 21

UniSQLOID[] car = (UniSQLOID[])rsgetCollection("car"); Systemoutprintln(" : " + user_name); Systemoutprintln(" : " + user_addr); // 2 // array for(int i=0; i<carlength; i++) { // getvalues null attribute urs = (UniSQLResultSet)car[i]getValues(null); // 3 ursnext(); String car_name = ursgetstring("name"); Systemoutprintln(" : " + car_name); Systemoutprintln("\n================================\n"); ursclose(); rsclose(); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); derived table Collection SET 1 : ResultSet close() ResultSet ResultSet autocommit close() ResultSet autocommit false 2 : SET, getcollection array 3 : array for 1 UniSQLOID getvalues getvalues attribute null null class attribute (3111 ) (3221 ) SM5 XG 22

322 SET API API OID 332 3221 SET import javasql*; insert OID { SET public class insertset { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // SET { // SET // car2 OID user_info2 SET String sql = "insert into user_info2 values (" + "' ', ' 679-4', { insert into car2 values (' ',{'2000cc',' ')," + "insert into car2 values ('SM5',{'2500cc',' '))"; // 1 stmt = conncreatestatement(); stmtexecuteupdate(sql); Systemoutprintln(" "); conncommit(); stmtclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); 23

SET { insert into car2(name, spec) values( SM5, { V6 2500cc, DUAL AIRBACK, ABS ) set_of(string) set_of(car2) { OID, OID, OID OID car2 class OID insert 323 SET API SET / 3231 SET import javasql*; SET public class updateset { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); // SET String sql = "update car2 set spec = spec - {' ' + {' stmt = conncreatestatement(); stmtexecuteupdate(sql); Systemoutprintln(" "); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); ' where name = ' '"; 1 : spec attribute // 1 24

3232 API SET SET API import javasql*; import unisqljdbcdriver*; import unisqlsql*; public class updateset2 { public static void main(string[] args) throws Exception { Connection null; Statement stmt = null; UniSQLResultSet rs = null; ClassforName("unisqljdbcdriverUniSQLDriver"); DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); String sql = "select car from user_info2 where name = ' '"; stmt = conncreatestatement(); rs = (UniSQLResultSet)stmtexecuteQuery(sql); while(rsnext()) { UniSQLOID[] car = (UniSQLOID[])rsgetCollection("car"); // API SET for(int i=0; i<carlength; i++) { car[i]addtoset("spec"," "); car[i]removefromset("spec"," "); // 1 rsclose(); stmtclose(); conncommit(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); 1 : 44 SET OID addtoset(attribute, ) / removefromset(attribute, ) 25

33 GLO GLO GLO LO, FBO 2 LO, FBO GLO class GLO class class Create class file_object under glo GLO LO 331 GLO InputStream file_object class import javasql*; import javaio*; import unisqlsql*; import unisqljdbcdriver*; public class insertlo { public static void main(string[] args) throws Exception { UniSQLConnection null; FileInputStream inputfile = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); (UniSQLConnection)DriverManagergetConnection("jdbc:unisql:192168010:43300:demodb:::","",""); 1 // file InputStream inputfile = new FileInputStream("/home/unisql/file/testtxt"); // file_object class UniSQLOID glo_oid = conngetnewglo("file_object", inputfile); inputfileclose(); conncommit(); connclose(); 2 3 catch ( SQLException e ) { Systemerrprintln(egetMessage()); 26

catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); 1 GLO UniSQLConnection 2 GLO InputStream 3 getnewglo() API getnewglo( class, InputStream) : InputStream class UniSQLOID 332 GLO GLO GLO import javasql*; import javaio*; import unisqlsql*; import unisqljdbcdriver*; public class selectglo { public static void main(string[] args) throws Exception { UniSQLConnection null; FileOutputStream outputfile = null; // UniSQL DB Connect ClassforName("unisqljdbcdriverUniSQLDriver"); (UniSQLConnection)DriverManagergetConnection("jdbc:unisql:21021633250:52500:shindb:::","",""); 1 // GLO OID String sql = "select file_object from file_object"; 27

Statement stmt = conncreatestatement(); ResultSet rs = stmtexecutequery(sql); rsnext(); UniSQLOID glo_oid = (UniSQLOID)rsgetObject("file_object"); 2 // loadglo GLO outputfile = new FileOutputStream("/home/unisql/file/tmp000"); glo_oidloadglo(outputfile); 4 3 outputfileclose(); rsclose(); conncommit(); connclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); catch ( Exception e ) { Systemerrprintln(egetMessage()); finally { if ( conn!= null ) connclose(); catch ( SQLException e ) { Systemerrprintln(egetMessage()); 1 UniSQLConnection 2 OID 3 OutPutStream 4 loadglo() API GLO loadglo(outputstream) : GLO OutPutSteeam 28