Class: OCIServer

Inherits:
OCIHandle show all
Defined in:
ext/oci8/oci8.c

Instance Method Summary collapse

Methods inherited from OCIHandle

#attrGet, #attrSet, #free, new

Instance Method Details

#attach(*args) ⇒ Object

begin

— OCIServer#attach(dbname [, mode])

attach to the database.
:dbname
   the name of database.
:mode
   ((|OCI_DEFAULT|)) or ((|OCI_CPOOL|))(Oracle 9i). Default value is ((|OCI_DEFAULT|)).

   This ruby module doesn't support the connection pooling provided by OCI,
   so ((|OCI_CPOOL|)) is invalid value for now.

correspond native OCI function: ((|OCIServerAttach|))

end



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'ext/oci8/server.c', line 33

static VALUE oci8_server_attach(int argc, VALUE *argv, VALUE self)
{
  VALUE vdbname, vmode;
  oci8_handle_t *h;
  oci8_string_t d;
  ub4 mode;
  sword rv;

  rb_scan_args(argc, argv, "11", &vdbname, &vmode);
  Get_Handle(self, h); /* 0 */
  Get_String(vdbname, d); /* 1 */
  Get_Int_With_Default(argc, 2, vmode, mode, OCI_DEFAULT); /* 2 */

  rv = OCIServerAttach(h->hp, h->errhp, d.ptr, d.len, mode);
  if (rv != OCI_SUCCESS)
    oci8_raise(h->errhp, rv, NULL);
  return self;
}

#breakObject

#detach(*args) ⇒ Object

begin

OCIServer#detach()

detach from the database.

:mode
   ((|OCI_DEFAULT|)) only valid. Default value is ((|OCI_DEFAULT|)).

correspond native OCI function: ((|OCIServerDetach|))

end



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'ext/oci8/server.c', line 63

static VALUE oci8_server_detach(int argc, VALUE *argv, VALUE self)
{
  VALUE vmode;
  oci8_handle_t *h;
  ub4 mode;
  sword rv;


  rb_scan_args(argc, argv, "01", &vmode);
  Get_Handle(self, h); /* 0 */
  Get_Int_With_Default(argc, 1, vmode, mode, OCI_DEFAULT); /* 1 */

  rv = OCIServerDetach(h->hp, h->errhp, mode);
  if (rv != OCI_SUCCESS)
    oci8_raise(h->errhp, rv, NULL);
  return self;
}

#releaseObject

#resetObject

#versionObject