ruby-oci8 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/ext/oci8/oci8.c CHANGED
@@ -329,15 +329,16 @@ static const oci8_logoff_strategy_t complex_logoff = {
329
329
 
330
330
  /*
331
331
  * call-seq:
332
- * logon(username, password, dbname) -> connection
332
+ * logon2(username, password, dbname, mode) -> connection
333
333
  *
334
334
  * <b>internal use only</b>
335
335
  *
336
- * Creates a simple logon session by the OCI function OCILogon().
336
+ * Creates a simple logon session by the OCI function OCILogon2().
337
337
  */
338
- static VALUE oci8_logon(VALUE self, VALUE username, VALUE password, VALUE dbname)
338
+ static VALUE oci8_logon2(VALUE self, VALUE username, VALUE password, VALUE dbname, VALUE mode)
339
339
  {
340
340
  oci8_svcctx_t *svcctx = DATA_PTR(self);
341
+ ub4 logon2_mode;
341
342
 
342
343
  if (svcctx->logoff_strategy != NULL) {
343
344
  rb_raise(rb_eRuntimeError, "Could not reuse the session.");
@@ -349,17 +350,22 @@ static VALUE oci8_logon(VALUE self, VALUE username, VALUE password, VALUE dbname
349
350
  if (!NIL_P(dbname)) {
350
351
  OCI8SafeStringValue(dbname);
351
352
  }
353
+ logon2_mode = NUM2UINT(mode);
352
354
 
353
355
  /* logon */
354
356
  svcctx->base.type = OCI_HTYPE_SVCCTX;
355
- chker2(OCILogon_nb(svcctx, oci8_envhp, oci8_errhp, &svcctx->base.hp.svc,
356
- RSTRING_ORATEXT(username), RSTRING_LEN(username),
357
- RSTRING_ORATEXT(password), RSTRING_LEN(password),
358
- NIL_P(dbname) ? NULL : RSTRING_ORATEXT(dbname),
359
- NIL_P(dbname) ? 0 : RSTRING_LEN(dbname)),
357
+ chker2(OCILogon2_nb(svcctx, oci8_envhp, oci8_errhp, &svcctx->base.hp.svc,
358
+ RSTRING_ORATEXT(username), RSTRING_LEN(username),
359
+ RSTRING_ORATEXT(password), RSTRING_LEN(password),
360
+ NIL_P(dbname) ? NULL : RSTRING_ORATEXT(dbname),
361
+ NIL_P(dbname) ? 0 : RSTRING_LEN(dbname), logon2_mode),
360
362
  &svcctx->base);
361
363
  svcctx->logoff_strategy = &simple_logoff;
362
364
 
365
+ if (logon2_mode & OCI_LOGON2_CPOOL) {
366
+ svcctx->state |= OCI8_STATE_CPOOL;
367
+ }
368
+
363
369
  /* setup the session handle */
364
370
  chker2(OCIAttrGet(svcctx->base.hp.ptr, OCI_HTYPE_SVCCTX, &svcctx->usrhp, 0, OCI_ATTR_SESSION, oci8_errhp),
365
371
  &svcctx->base);
@@ -1099,7 +1105,7 @@ VALUE Init_oci8(void)
1099
1105
  rb_define_singleton_method_nodoc(cOCI8, "__set_property", oci8_s_set_property, 2);
1100
1106
  rb_define_singleton_method(cOCI8, "error_message", oci8_s_error_message, 1);
1101
1107
  rb_define_private_method(cOCI8, "parse_connect_string", oci8_parse_connect_string, 1);
1102
- rb_define_private_method(cOCI8, "logon", oci8_logon, 3);
1108
+ rb_define_private_method(cOCI8, "logon2", oci8_logon2, 4);
1103
1109
  rb_define_private_method(cOCI8, "allocate_handles", oci8_allocate_handles, 0);
1104
1110
  rb_define_private_method(cOCI8, "session_handle", oci8_get_session_handle, 0);
1105
1111
  rb_define_private_method(cOCI8, "server_handle", oci8_get_server_handle, 0);
data/ext/oci8/oci8.h CHANGED
@@ -521,13 +521,21 @@ void Init_ora_date(void);
521
521
  /* ocinumber.c */
522
522
  extern int oci8_float_conversion_type_is_ruby;
523
523
  void Init_oci_number(VALUE mOCI, OCIError *errhp);
524
+ /* OraNumber (ruby object) -> OCINumber (C datatype) */
524
525
  OCINumber *oci8_get_ocinumber(VALUE num);
526
+ /* OCINumber (C datatype) -> OraNumber (ruby object) */
525
527
  VALUE oci8_make_ocinumber(OCINumber *s, OCIError *errhp);
528
+ /* OCINumber (C datatype) -> Integer (ruby object) */
526
529
  VALUE oci8_make_integer(OCINumber *s, OCIError *errhp);
530
+ /* OCINumber (C datatype) -> Float (ruby object) */
527
531
  VALUE oci8_make_float(OCINumber *s, OCIError *errhp);
532
+ /* Numeric (ruby object) -> OCINumber (C datatype) */
528
533
  OCINumber *oci8_set_ocinumber(OCINumber *result, VALUE self, OCIError *errhp);
534
+ /* Numeric (ruby object) -> OCINumber (C datatype) as an integer */
529
535
  OCINumber *oci8_set_integer(OCINumber *result, VALUE self, OCIError *errhp);
536
+ /* OCINumber (C datatype) -> double (C datatype) */
530
537
  double oci8_onum_to_dbl(OCINumber *s, OCIError *errhp);
538
+ /* double (C datatype) -> OCINumber (C datatype) */
531
539
  OCINumber *oci8_dbl_to_onum(OCINumber *result, double dbl, OCIError *errhp);
532
540
 
533
541
  /* ocidatetim.c */
data/ext/oci8/oci8lib.c CHANGED
@@ -37,10 +37,15 @@ void oci8_base_free(oci8_base_t *base)
37
37
  oci8_unlink_from_parent(base);
38
38
  if (base->vptr->free != NULL)
39
39
  base->vptr->free(base);
40
- if (base->type >= OCI_DTYPE_FIRST)
40
+ if (base->type >= OCI_DTYPE_FIRST) {
41
41
  OCIDescriptorFree(base->hp.ptr, base->type);
42
- else if (base->type >= OCI_HTYPE_FIRST)
42
+ } else if (base->type == OCI_HTYPE_BIND || base->type == OCI_HTYPE_DEFINE) {
43
+ ; /* Do nothing. Bind handles and define handles are freed when
44
+ * associating statement handles are freed.
45
+ */
46
+ } else if (base->type >= OCI_HTYPE_FIRST) {
43
47
  OCIHandleFree(base->hp.ptr, base->type);
48
+ }
44
49
  base->type = 0;
45
50
  base->hp.ptr = NULL;
46
51
  }
data/ext/oci8/ocihandle.c CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  * ocihandle.c
4
4
  *
5
- * Copyright (C) 2009-2010 KUBO Takehiro <kubo@jiubao.org>
5
+ * Copyright (C) 2009-2012 KUBO Takehiro <kubo@jiubao.org>
6
6
  *
7
7
  * implement OCIHandle
8
8
  *
@@ -38,12 +38,10 @@ static VALUE oci8_handle_initialize(VALUE self)
38
38
  }
39
39
 
40
40
  /*
41
- * call-seq:
42
- * free()
43
- *
44
- * <b>(new in 2.0.0)</b>
45
- *
46
41
  * Clears the object internal structure and its dependents.
42
+ *
43
+ * @since 2.0.0
44
+ * @private
47
45
  */
48
46
  static VALUE oci8_handle_free(VALUE self)
49
47
  {
@@ -107,11 +105,15 @@ static VALUE oci8_s_allocate(VALUE klass)
107
105
 
108
106
  /*
109
107
  * call-seq:
110
- * attr_get_ub1(attr_type) -> fixnum
111
- *
112
- * <b>(new in 2.0.4)</b>
108
+ * attr_get_ub1(attr_type)
113
109
  *
114
110
  * Gets the value of an attribute as `ub1' datatype.
111
+ *
112
+ * @param [Fixnum] attr_type
113
+ * @return [Fixnum]
114
+ *
115
+ * @since 2.0.4
116
+ * @private
115
117
  */
116
118
  static VALUE attr_get_ub1(VALUE self, VALUE attr_type)
117
119
  {
@@ -129,11 +131,15 @@ static VALUE attr_get_ub1(VALUE self, VALUE attr_type)
129
131
 
130
132
  /*
131
133
  * call-seq:
132
- * attr_get_ub2(attr_type) -> fixnum
133
- *
134
- * <b>(new in 2.0.4)</b>
134
+ * attr_get_ub2(attr_type)
135
135
  *
136
136
  * Gets the value of an attribute as `ub2' datatype.
137
+ *
138
+ * @param [Fixnum] attr_type
139
+ * @return [Fixnum]
140
+ *
141
+ * @since 2.0.4
142
+ * @private
137
143
  */
138
144
  static VALUE attr_get_ub2(VALUE self, VALUE attr_type)
139
145
  {
@@ -151,11 +157,15 @@ static VALUE attr_get_ub2(VALUE self, VALUE attr_type)
151
157
 
152
158
  /*
153
159
  * call-seq:
154
- * attr_get_ub4(attr_type) -> integer
155
- *
156
- * <b>(new in 2.0.4)</b>
160
+ * attr_get_ub4(attr_type)
157
161
  *
158
162
  * Gets the value of an attribute as `ub4' datatype.
163
+ *
164
+ * @param [Fixnum] attr_type
165
+ * @return [Integer]
166
+ *
167
+ * @since 2.0.4
168
+ * @private
159
169
  */
160
170
  static VALUE attr_get_ub4(VALUE self, VALUE attr_type)
161
171
  {
@@ -173,11 +183,15 @@ static VALUE attr_get_ub4(VALUE self, VALUE attr_type)
173
183
 
174
184
  /*
175
185
  * call-seq:
176
- * attr_get_ub8(attr_type) -> integer
177
- *
178
- * <b>(new in 2.0.4)</b>
186
+ * attr_get_ub8(attr_type)
179
187
  *
180
188
  * Gets the value of an attribute as `ub8' datatype.
189
+ *
190
+ * @param [Fixnum] attr_type
191
+ * @return [Integer]
192
+ *
193
+ * @since 2.0.4
194
+ * @private
181
195
  */
182
196
  static VALUE attr_get_ub8(VALUE self, VALUE attr_type)
183
197
  {
@@ -195,11 +209,15 @@ static VALUE attr_get_ub8(VALUE self, VALUE attr_type)
195
209
 
196
210
  /*
197
211
  * call-seq:
198
- * attr_get_sb1(attr_type) -> fixnum
199
- *
200
- * <b>(new in 2.0.4)</b>
212
+ * attr_get_sb1(attr_type)
201
213
  *
202
214
  * Gets the value of an attribute as `sb1' datatype.
215
+ *
216
+ * @param [Fixnum] attr_type
217
+ * @return [Fixnum]
218
+ *
219
+ * @since 2.0.4
220
+ * @private
203
221
  */
204
222
  static VALUE attr_get_sb1(VALUE self, VALUE attr_type)
205
223
  {
@@ -217,11 +235,15 @@ static VALUE attr_get_sb1(VALUE self, VALUE attr_type)
217
235
 
218
236
  /*
219
237
  * call-seq:
220
- * attr_get_sb2(attr_type) -> fixnum
221
- *
222
- * <b>(new in 2.0.4)</b>
238
+ * attr_get_sb2(attr_type)
223
239
  *
224
240
  * Gets the value of an attribute as `sb2' datatype.
241
+ *
242
+ * @param [Fixnum] attr_type
243
+ * @return [Fixnum]
244
+ *
245
+ * @since 2.0.4
246
+ * @private
225
247
  */
226
248
  static VALUE attr_get_sb2(VALUE self, VALUE attr_type)
227
249
  {
@@ -239,11 +261,15 @@ static VALUE attr_get_sb2(VALUE self, VALUE attr_type)
239
261
 
240
262
  /*
241
263
  * call-seq:
242
- * attr_get_sb4(attr_type) -> integer
243
- *
244
- * <b>(new in 2.0.4)</b>
264
+ * attr_get_sb4(attr_type)
245
265
  *
246
266
  * Gets the value of an attribute as `sb4' datatype.
267
+ *
268
+ * @param [Fixnum] attr_type
269
+ * @return [Integer]
270
+ *
271
+ * @since 2.0.4
272
+ * @private
247
273
  */
248
274
  static VALUE attr_get_sb4(VALUE self, VALUE attr_type)
249
275
  {
@@ -261,11 +287,15 @@ static VALUE attr_get_sb4(VALUE self, VALUE attr_type)
261
287
 
262
288
  /*
263
289
  * call-seq:
264
- * attr_get_sb8(attr_type) -> integer
265
- *
266
- * <b>(new in 2.0.4)</b>
290
+ * attr_get_sb8(attr_type)
267
291
  *
268
292
  * Gets the value of an attribute as `sb8' datatype.
293
+ *
294
+ * @param [Fixnum] attr_type
295
+ * @return [Integer]
296
+ *
297
+ * @since 2.0.4
298
+ * @private
269
299
  */
270
300
  static VALUE attr_get_sb8(VALUE self, VALUE attr_type)
271
301
  {
@@ -283,11 +313,15 @@ static VALUE attr_get_sb8(VALUE self, VALUE attr_type)
283
313
 
284
314
  /*
285
315
  * call-seq:
286
- * attr_get_boolean(attr_type) -> true or false
287
- *
288
- * <b>(new in 2.0.4)</b>
316
+ * attr_get_boolean(attr_type)
289
317
  *
290
318
  * Gets the value of an attribute as `boolean' datatype.
319
+ *
320
+ * @param [Fixnum] attr_type
321
+ * @return [true of false]
322
+ *
323
+ * @since 2.0.4
324
+ * @private
291
325
  */
292
326
  static VALUE attr_get_boolean(VALUE self, VALUE attr_type)
293
327
  {
@@ -305,16 +339,20 @@ static VALUE attr_get_boolean(VALUE self, VALUE attr_type)
305
339
 
306
340
  /*
307
341
  * call-seq:
308
- * attr_get_string(attr_type) -> string
309
- *
310
- * <b>(new in 2.0.4)</b>
342
+ * attr_get_string(attr_type)
311
343
  *
312
344
  * Gets the value of an attribute as `oratext *' datatype.
313
345
  * The return value is converted to Encoding.default_internal or
314
- * tagged with OCI8.encoding when the ruby version is 1.9.
346
+ * tagged with {OCI8.encoding} when the ruby version is 1.9.
347
+ *
348
+ * @note If the specified attr_type's datatype is not a
349
+ * pointer type, it causes a segmentation fault.
350
+ *
351
+ * @param [Fixnum] attr_type
352
+ * @return [String]
315
353
  *
316
- * <b>Caution:</b> If the specified attr_type's datatype is not a
317
- * pointer type, it causes a segmentation fault.
354
+ * @since 2.0.4
355
+ * @private
318
356
  */
319
357
  static VALUE attr_get_string(VALUE self, VALUE attr_type)
320
358
  {
@@ -333,15 +371,19 @@ static VALUE attr_get_string(VALUE self, VALUE attr_type)
333
371
 
334
372
  /*
335
373
  * call-seq:
336
- * attr_get_binary(attr_type) -> string
337
- *
338
- * <b>(new in 2.0.4)</b>
374
+ * attr_get_binary(attr_type)
339
375
  *
340
376
  * Gets the value of an attribute as `ub1 *' datatype.
341
377
  * The return value is tagged with ASCII-8BIT when the ruby version is 1.9.
342
378
  *
343
- * <b>Caution:</b> If the specified attr_type's datatype is not a
344
- * pointer type, it causes a segmentation fault.
379
+ * @note If the specified attr_type's datatype is not a
380
+ * pointer type, it causes a segmentation fault.
381
+ *
382
+ * @param [Fixnum] attr_type
383
+ * @return [String]
384
+ *
385
+ * @since 2.0.4
386
+ * @private
345
387
  */
346
388
  static VALUE attr_get_binary(VALUE self, VALUE attr_type)
347
389
  {
@@ -362,13 +404,17 @@ static VALUE attr_get_binary(VALUE self, VALUE attr_type)
362
404
  * call-seq:
363
405
  * attr_get_integer(attr_type) -> integer
364
406
  *
365
- * <b>(new in 2.0.4)</b>
366
- *
367
407
  * Gets the value of an attribute as `ub1 *' datatype.
368
408
  * The return value is converted to Integer from internal Oracle NUMBER format.
369
409
  *
370
- * <b>Caution:</b> If the specified attr_type's datatype is not a
371
- * pointer type, it causes a segmentation fault.
410
+ * @note If the specified attr_type's datatype is not a
411
+ * pointer type, it causes a segmentation fault.
412
+ *
413
+ * @param [Fixnum] attr_type
414
+ * @return [Fixnum]
415
+ *
416
+ * @since 2.0.4
417
+ * @private
372
418
  */
373
419
  static VALUE attr_get_integer(VALUE self, VALUE attr_type)
374
420
  {
@@ -389,13 +435,17 @@ static VALUE attr_get_integer(VALUE self, VALUE attr_type)
389
435
  * call-seq:
390
436
  * attr_get_oradate(attr_type) -> an OraDate
391
437
  *
392
- * <b>(new in 2.1.0)</b>
393
- *
394
438
  * Gets the value of an attribute as `ub1 *' datatype.
395
439
  * The return value is converted to OraDate.
396
440
  *
397
- * <b>Caution:</b> If the specified attr_type's datatype is not a
398
- * pointer type, it causes a segmentation fault.
441
+ * @note If the specified attr_type's datatype is not a
442
+ * pointer type, it causes a segmentation fault.
443
+ *
444
+ * @param [Fixnum] attr_type
445
+ * @return [OraDate]
446
+ *
447
+ * @since 2.0.4
448
+ * @private
399
449
  */
400
450
  static VALUE attr_get_oradate(VALUE self, VALUE attr_type)
401
451
  {
@@ -425,12 +475,17 @@ static VALUE attr_get_oradate(VALUE self, VALUE attr_type)
425
475
  * call-seq:
426
476
  * attr_set_ub1(attr_type, attr_value)
427
477
  *
428
- * <b>(new in 2.0.4)</b>
429
- *
430
478
  * Sets the value of an attribute as `ub1' datatype.
431
479
  *
432
- * <b>Caution:</b> If the specified attr_type's datatype is a
433
- * pointer type, it causes a segmentation fault.
480
+ * @note If the specified attr_type's datatype is a
481
+ * pointer type, it causes a segmentation fault.
482
+ *
483
+ * @param [Fixnum] attr_type
484
+ * @param [Fixnum] attr_value
485
+ * @return [self]
486
+ *
487
+ * @since 2.0.4
488
+ * @private
434
489
  */
435
490
  static VALUE attr_set_ub1(VALUE self, VALUE attr_type, VALUE val)
436
491
  {
@@ -449,12 +504,17 @@ static VALUE attr_set_ub1(VALUE self, VALUE attr_type, VALUE val)
449
504
  * call-seq:
450
505
  * attr_set_ub2(attr_type, attr_value)
451
506
  *
452
- * <b>(new in 2.0.4)</b>
453
- *
454
507
  * Sets the value of an attribute as `ub2' datatype.
455
508
  *
456
- * <b>Caution:</b> If the specified attr_type's datatype is a
457
- * pointer type, it causes a segmentation fault.
509
+ * @note If the specified attr_type's datatype is a
510
+ * pointer type, it causes a segmentation fault.
511
+ *
512
+ * @param [Fixnum] attr_type
513
+ * @param [Fixnum] attr_value
514
+ * @return [self]
515
+ *
516
+ * @since 2.0.4
517
+ * @private
458
518
  */
459
519
  static VALUE attr_set_ub2(VALUE self, VALUE attr_type, VALUE val)
460
520
  {
@@ -473,12 +533,17 @@ static VALUE attr_set_ub2(VALUE self, VALUE attr_type, VALUE val)
473
533
  * call-seq:
474
534
  * attr_set_ub4(attr_type, attr_value)
475
535
  *
476
- * <b>(new in 2.0.4)</b>
477
- *
478
536
  * Sets the value of an attribute as `ub4' datatype.
479
537
  *
480
- * <b>Caution:</b> If the specified attr_type's datatype is a
481
- * pointer type, it causes a segmentation fault.
538
+ * @note If the specified attr_type's datatype is a
539
+ * pointer type, it causes a segmentation fault.
540
+ *
541
+ * @param [Fixnum] attr_type
542
+ * @param [Integer] attr_value
543
+ * @return [self]
544
+ *
545
+ * @since 2.0.4
546
+ * @private
482
547
  */
483
548
  static VALUE attr_set_ub4(VALUE self, VALUE attr_type, VALUE val)
484
549
  {
@@ -497,12 +562,17 @@ static VALUE attr_set_ub4(VALUE self, VALUE attr_type, VALUE val)
497
562
  * call-seq:
498
563
  * attr_set_ub8(attr_type, attr_value)
499
564
  *
500
- * <b>(new in 2.0.4)</b>
501
- *
502
565
  * Sets the value of an attribute as `ub8' datatype.
503
566
  *
504
- * <b>Caution:</b> If the specified attr_type's datatype is a
505
- * pointer type, it causes a segmentation fault.
567
+ * @note If the specified attr_type's datatype is a
568
+ * pointer type, it causes a segmentation fault.
569
+ *
570
+ * @param [Fixnum] attr_type
571
+ * @param [Integer] attr_value
572
+ * @return [self]
573
+ *
574
+ * @since 2.0.4
575
+ * @private
506
576
  */
507
577
  static VALUE attr_set_ub8(VALUE self, VALUE attr_type, VALUE val)
508
578
  {
@@ -521,12 +591,17 @@ static VALUE attr_set_ub8(VALUE self, VALUE attr_type, VALUE val)
521
591
  * call-seq:
522
592
  * attr_set_sb1(attr_type, attr_value)
523
593
  *
524
- * <b>(new in 2.0.4)</b>
525
- *
526
594
  * Sets the value of an attribute as `sb1' datatype.
527
595
  *
528
- * <b>Caution:</b> If the specified attr_type's datatype is a
529
- * pointer type, it causes a segmentation fault.
596
+ * @note If the specified attr_type's datatype is a
597
+ * pointer type, it causes a segmentation fault.
598
+ *
599
+ * @param [Fixnum] attr_type
600
+ * @param [Fixnum] attr_value
601
+ * @return [self]
602
+ *
603
+ * @since 2.0.4
604
+ * @private
530
605
  */
531
606
  static VALUE attr_set_sb1(VALUE self, VALUE attr_type, VALUE val)
532
607
  {
@@ -545,12 +620,17 @@ static VALUE attr_set_sb1(VALUE self, VALUE attr_type, VALUE val)
545
620
  * call-seq:
546
621
  * attr_set_sb2(attr_type, attr_value)
547
622
  *
548
- * <b>(new in 2.0.4)</b>
549
- *
550
623
  * Sets the value of an attribute as `sb2' datatype.
551
624
  *
552
- * <b>Caution:</b> If the specified attr_type's datatype is a
553
- * pointer type, it causes a segmentation fault.
625
+ * @note If the specified attr_type's datatype is a
626
+ * pointer type, it causes a segmentation fault.
627
+ *
628
+ * @param [Fixnum] attr_type
629
+ * @param [Fixnum] attr_value
630
+ * @return [self]
631
+ *
632
+ * @since 2.0.4
633
+ * @private
554
634
  */
555
635
  static VALUE attr_set_sb2(VALUE self, VALUE attr_type, VALUE val)
556
636
  {
@@ -569,12 +649,17 @@ static VALUE attr_set_sb2(VALUE self, VALUE attr_type, VALUE val)
569
649
  * call-seq:
570
650
  * attr_set_sb4(attr_type, attr_value)
571
651
  *
572
- * <b>(new in 2.0.4)</b>
573
- *
574
652
  * Sets the value of an attribute as `sb4' datatype.
575
653
  *
576
- * <b>Caution:</b> If the specified attr_type's datatype is a
577
- * pointer type, it causes a segmentation fault.
654
+ * @note If the specified attr_type's datatype is a
655
+ * pointer type, it causes a segmentation fault.
656
+ *
657
+ * @param [Fixnum] attr_type
658
+ * @param [Integer] attr_value
659
+ * @return [self]
660
+ *
661
+ * @since 2.0.4
662
+ * @private
578
663
  */
579
664
  static VALUE attr_set_sb4(VALUE self, VALUE attr_type, VALUE val)
580
665
  {
@@ -593,12 +678,17 @@ static VALUE attr_set_sb4(VALUE self, VALUE attr_type, VALUE val)
593
678
  * call-seq:
594
679
  * attr_set_sb8(attr_type, attr_value)
595
680
  *
596
- * <b>(new in 2.0.4)</b>
597
- *
598
681
  * Sets the value of an attribute as `sb8' datatype.
599
682
  *
600
- * <b>Caution:</b> If the specified attr_type's datatype is a
601
- * pointer type, it causes a segmentation fault.
683
+ * @note If the specified attr_type's datatype is a
684
+ * pointer type, it causes a segmentation fault.
685
+ *
686
+ * @param [Fixnum] attr_type
687
+ * @param [Integer] attr_value
688
+ * @return [self]
689
+ *
690
+ * @since 2.0.4
691
+ * @private
602
692
  */
603
693
  static VALUE attr_set_sb8(VALUE self, VALUE attr_type, VALUE val)
604
694
  {
@@ -617,12 +707,17 @@ static VALUE attr_set_sb8(VALUE self, VALUE attr_type, VALUE val)
617
707
  * call-seq:
618
708
  * attr_set_boolean(attr_type, attr_value)
619
709
  *
620
- * <b>(new in 2.0.4)</b>
621
- *
622
710
  * Sets the value of an attribute as `boolean' datatype.
623
711
  *
624
- * <b>Caution:</b> If the specified attr_type's datatype is a
625
- * pointer type, it causes a segmentation fault.
712
+ * @note If the specified attr_type's datatype is a
713
+ * pointer type, it causes a segmentation fault.
714
+ *
715
+ * @param [Fixnum] attr_type
716
+ * @param [true or false] attr_value
717
+ * @return [self]
718
+ *
719
+ * @since 2.0.4
720
+ * @private
626
721
  */
627
722
  static VALUE attr_set_boolean(VALUE self, VALUE attr_type, VALUE val)
628
723
  {
@@ -639,13 +734,18 @@ static VALUE attr_set_boolean(VALUE self, VALUE attr_type, VALUE val)
639
734
 
640
735
  /*
641
736
  * call-seq:
642
- * attr_set_string(attr_type, string_value)
643
- *
644
- * <b>(new in 2.0.4)</b>
737
+ * attr_set_string(attr_type, attr_value)
645
738
  *
646
739
  * Sets the value of an attribute as `oratext *' datatype.
647
- * +string_value+ is converted to OCI8.encoding before it is set
740
+ * +attr_value+ is converted to {OCI8.encoding} before it is set
648
741
  * when the ruby version is 1.9.
742
+ *
743
+ * @param [Fixnum] attr_type
744
+ * @param [String] attr_value
745
+ * @return [self]
746
+ *
747
+ * @since 2.0.4
748
+ * @private
649
749
  */
650
750
  static VALUE attr_set_string(VALUE self, VALUE attr_type, VALUE val)
651
751
  {
@@ -661,11 +761,16 @@ static VALUE attr_set_string(VALUE self, VALUE attr_type, VALUE val)
661
761
 
662
762
  /*
663
763
  * call-seq:
664
- * attr_set_binary(attr_type, string_value)
665
- *
666
- * <b>(new in 2.0.4)</b>
764
+ * attr_set_binary(attr_type, attr_value)
667
765
  *
668
766
  * Sets the value of an attribute as `ub1 *' datatype.
767
+ *
768
+ * @param [Fixnum] attr_type
769
+ * @param [String] attr_value
770
+ * @return [self]
771
+ *
772
+ * @since 2.0.4
773
+ * @private
669
774
  */
670
775
  static VALUE attr_set_binary(VALUE self, VALUE attr_type, VALUE val)
671
776
  {
@@ -683,11 +788,16 @@ static VALUE attr_set_binary(VALUE self, VALUE attr_type, VALUE val)
683
788
  * call-seq:
684
789
  * attr_set_integer(attr_type, number)
685
790
  *
686
- * <b>(new in 2.0.4)</b>
687
- *
688
791
  * Sets the value of an attribute as `ub1 *' datatype.
689
792
  * +number+ is converted to internal Oracle NUMBER format before
690
793
  * it is set.
794
+ *
795
+ * @param [Fixnum] attr_type
796
+ * @param [Numeric] number
797
+ * @return [self]
798
+ *
799
+ * @since 2.0.4
800
+ * @private
691
801
  */
692
802
  static VALUE attr_set_integer(VALUE self, VALUE attr_type, VALUE val)
693
803
  {
@@ -707,11 +817,11 @@ void Init_oci8_handle(void)
707
817
  VALUE obj;
708
818
 
709
819
  /*
710
- * <b>(new in 2.0.0)</b>
711
- *
712
820
  * OCIHandle is the abstract base class of OCI handles and
713
821
  * OCI descriptors; opaque data types of Oracle Call Interface.
714
822
  * Don't use constants and methods defined in the class.
823
+ *
824
+ * @since 2.0.0
715
825
  */
716
826
  oci8_cOCIHandle = rb_define_class("OCIHandle", rb_cObject);
717
827
  rb_define_alloc_func(oci8_cOCIHandle, oci8_s_allocate);