Method: SQLAnywhere::SQLAnywhereInterface#sqlany_new_connection

Defined in:
ext/sqlanywhere.c

#sqlany_new_connection(VALUEapi) ⇒ Object

Creates a connection object.

An API connection object needs to be created before a database connection
is established. Errors can be retrieved from the connection object. Only
one request can be processed on a connection at a time.

<b>Parameters</b>:
- <tt>VALUE api</tt> -- An initialized API structure to finalize.

<b>Returns</b>:
- <tt>VALUE connection</tt>: A connection object.


307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'ext/sqlanywhere.c', line 307

static VALUE
static_SQLAnywhereInterface_sqlany_new_connection(VALUE api)
{
    SQLAnywhereInterface* s_api;
    a_sqlany_connection* ptr;
    VALUE tdata;

    Data_Get_Struct(api, SQLAnywhereInterface, s_api);
    ptr = s_api->sqlany_new_connection();

    tdata = Data_Wrap_Struct(cA_sqlany_connection, 0, 0, ptr);
    
    return (tdata);
}