- Page 1: IBM Informix Developer’s Handbook
- Page 4 and 5: Note: Before using this information
- Page 8 and 9: 8.3.1 Connecting to the database .
- Page 10 and 11: 12.5.2 Compiling the wrapper code .
- Page 12 and 13: Trademarks IBM, the IBM logo, and i
- Page 14 and 15: Krishna Doddi (also known as Prasad
- Page 16 and 17: Comments welcome Your comments are
- Page 18 and 19: 1.1 Server options There are a numb
- Page 20 and 21: This edition offers the following a
- Page 22 and 23: either an HDR secondary or RSS seco
- Page 24 and 25: There are three edition options for
- Page 26 and 27: functions. An application calls the
- Page 28 and 29: The IBM Data Server Driver for JDBC
- Page 30 and 31: OLEDB Microsoft OLE DB is a specifi
- Page 32 and 33: The DataBlade Developers Kit provid
- Page 34 and 35: 1.3.1 Architecture overview An unde
- Page 36 and 37: Physical and logical logging As eac
- Page 38 and 39: Before you select an API or library
- Page 40 and 41: Hidden, behind-the- scenes tasking
- Page 42 and 43: 2.1 Server setup In this section, w
- Page 44 and 45: A typical sqlhosts file contains th
- Page 46 and 47: Figure 2-1 shows the Server Informa
- Page 48 and 49: with the existing Informix instance
- Page 50 and 51: 2.2 Client setup ► Edit the Infor
- Page 52 and 53: Figure 2-4 illustrates the options
- Page 54 and 55: 2. Prepare the environment. You nee
- Page 56 and 57:
5. If you selected a Custom install
- Page 58 and 59:
At this stage, the Client SDK insta
- Page 60 and 61:
You can download some of these comp
- Page 62 and 63:
46 IBM Informix Developer’s Handb
- Page 64 and 65:
2. On the Software License Agreemen
- Page 66 and 67:
5. Verify the installation selectio
- Page 68 and 69:
3. Extract the IBM Data Server Driv
- Page 70 and 71:
For a silent installation on both W
- Page 72 and 73:
Configuring the JDBC driver To use
- Page 74 and 75:
3.1 ODBC and Informix ODBC is a sof
- Page 76 and 77:
► IBM Informix ODBC Driver (64-bi
- Page 78 and 79:
You can set optional configuration
- Page 80 and 81:
Parameter Description Insert Cursor
- Page 82 and 83:
Table 3-5 shows the ODBC libraries
- Page 84 and 85:
Keyword Description DriverODBCVer S
- Page 86 and 87:
Keyword Description DESCRIBEDECIMAL
- Page 88 and 89:
If there is no database alias defin
- Page 90 and 91:
Example 3-5 shows a simple db2cli.i
- Page 92 and 93:
The application sends SQL request t
- Page 94 and 95:
} 78 IBM Informix Developer’s Han
- Page 96 and 97:
SQLSMALLINT DecimalDigits, /* ibSca
- Page 98 and 99:
If your application requires only S
- Page 100 and 101:
84 IBM Informix Developer’s Handb
- Page 102 and 103:
} SQLCHAR sname[15+1]; SQLLEN lcode
- Page 104 and 105:
fprintf (stdout, "Connected\n"); 88
- Page 106 and 107:
SQLAllocHandle (SQL_HANDLE_ENV, SQL
- Page 108 and 109:
SQLAllocHandle (SQL_HANDLE_ENV, SQL
- Page 110 and 111:
94 IBM Informix Developer’s Handb
- Page 112 and 113:
contains the data or special attrib
- Page 114 and 115:
Function Description ifx_lo_specset
- Page 116 and 117:
SQLSMALLINT lospec_size; SQLINTEGER
- Page 118 and 119:
4. Call ifx_lo_open() to open the s
- Page 120 and 121:
SQLBindParameter (hstmt, 1, SQL_PAR
- Page 122 and 123:
} SQLFreeHandle (SQL_HANDLE_ENV, he
- Page 124 and 125:
SQLCHAR*insertStmt = (SQLCHAR *) "I
- Page 126 and 127:
Accessing a complex data type Examp
- Page 128 and 129:
C:\work> 3.3.5 Error handling Ludwi
- Page 130 and 131:
C:\work>connect_error demo_on;UID=w
- Page 132 and 133:
We create a function called CheckDi
- Page 134 and 135:
Figure 3-14 shows the Tracing tab.
- Page 136 and 137:
Example 3-36 demonstrates how to se
- Page 138 and 139:
DRDADEBUG All IBM Data Server drive
- Page 140 and 141:
124 IBM Informix Developer’s Hand
- Page 142 and 143:
4.1 Informix ESQL/C Informix ESQL/C
- Page 144 and 145:
Example 4-1 shows a simple sqlhosts
- Page 146 and 147:
Compiling ESQL/C programs The esql
- Page 148 and 149:
Platform Environment variable Linux
- Page 150 and 151:
Example 4-3 shows a statement that
- Page 152 and 153:
:fname[i], :lname[i], :company[i],
- Page 154 and 155:
The SELECT statement shown in Examp
- Page 156 and 157:
EXEC SQL fetch ex_cursor into :n1,:
- Page 158 and 159:
Table 4-3 lists a few ESQL/C data t
- Page 160 and 161:
the sbspace in the server before yo
- Page 162 and 163:
Example 4-10 shows the ESQL/C comma
- Page 164 and 165:
Example 4-12 shows the output of Ex
- Page 166 and 167:
} EXEC SQL END DECLARE SECTION; 150
- Page 168 and 169:
C->S (16) Time: 2010-07-06 20:21:58
- Page 170 and 171:
5.1 JDBC drivers for an Informix da
- Page 172 and 173:
5.1.2 IBM Data Server Driver for JD
- Page 174 and 175:
Example 5-4 shows the CLASSPATH env
- Page 176 and 177:
Example 5-6 shows the compile line
- Page 178 and 179:
programmer uses Java data types to
- Page 180 and 181:
Example 5-9 shows the syntax of the
- Page 182 and 183:
" Connected to Informix Dynamic Ser
- Page 184 and 185:
5.4.2 Manipulating data In this sec
- Page 186 and 187:
conn.close(); } catch ( Exception e
- Page 188 and 189:
Example 5-15 demonstrates how to di
- Page 190 and 191:
conn = DriverManager.getConnection(
- Page 192 and 193:
con.setAutoCommit(false); Statement
- Page 194 and 195:
System.out.format("Last row: \t%d,"
- Page 196 and 197:
PreparedStatement pstmt=conn.prepar
- Page 198 and 199:
System.err.println(e); } } } Exampl
- Page 200 and 201:
Issuer: CN=bedfont.uk.ibm.com, O=ib
- Page 202 and 203:
5.6.1 Class not found errors The fo
- Page 204 and 205:
5.7.2 IBM Data Server Driver for JD
- Page 206 and 207:
6.1 Hibernate for Java This section
- Page 208 and 209:
A Hibernate application includes th
- Page 210 and 211:
6.2.2 Configuration File Descriptio
- Page 212 and 213:
Example 6-3 shows a hibernate.cfg.x
- Page 214 and 215:
name="State" table="States">
- Page 216 and 217:
Example 6-6 shows the CLASSPATH var
- Page 218 and 219:
informix password org.hibernate
- Page 220 and 221:
Example 6-11 shows basic Java code
- Page 222 and 223:
The only difference between the loa
- Page 224 and 225:
1, AZ, Arizona 2, CA, California C:
- Page 226 and 227:
Example 6-19 shows the output of th
- Page 228 and 229:
private Long id; private String cod
- Page 230 and 231:
214 IBM Informix Developer’s Hand
- Page 232 and 233:
7.1 IBM Informix OLE DB Provider In
- Page 234 and 235:
through COM. You can use it to test
- Page 236 and 237:
7.3.1 Supported interfaces An OLE D
- Page 238 and 239:
7.3.3 Type mapping Keyword Descript
- Page 240 and 241:
7.3.4 Cursors Informix OLE DB Provi
- Page 242 and 243:
Example 7-3 demonstrates how to con
- Page 244 and 245:
Connect to the Database Server CHEC
- Page 246 and 247:
#define CHECK(hr) if (((HRESULT)(hr
- Page 248 and 249:
} 232 IBM Informix Developer’s Ha
- Page 250 and 251:
if(lDataLength > 0) { // Call GetCh
- Page 252 and 253:
_bstr_t bstrPassWord = "password";
- Page 254 and 255:
Provider with some of the available
- Page 256 and 257:
cx.connectionstring = "Data Source=
- Page 258 and 259:
California 0.08250 c:\work> 7.4.3 S
- Page 260 and 261:
The user ID for the Informix databa
- Page 262 and 263:
happen that the 32-bit provider is
- Page 264 and 265:
7.5.2 Tracing Failure when handling
- Page 266 and 267:
A44: 53C Exit Object Address: 0x032
- Page 268 and 269:
252 IBM Informix Developer’s Hand
- Page 270 and 271:
8.1 Informix and .NET data provider
- Page 272 and 273:
Both providers have the same assemb
- Page 274 and 275:
Example 8-3 shows how to compile an
- Page 276 and 277:
Attribute Description Default Exclu
- Page 278 and 279:
The majority of the connection stri
- Page 280 and 281:
Data Server Provider for .NET type
- Page 282 and 283:
Example 8-7 shows the output of Exa
- Page 284 and 285:
Table 8-9 lists the methods that th
- Page 286 and 287:
Method Description IfxMonthSpan Get
- Page 288 and 289:
} } int drows=0; 272 IBM Informix D
- Page 290 and 291:
Example 8-16 shows the output of Ex
- Page 292 and 293:
276 IBM Informix Developer’s Hand
- Page 294 and 295:
Method Description Int64 Seek(offse
- Page 296 and 297:
... 280 IBM Informix Developer’s
- Page 298 and 299:
IfxConnection conn; IfxClob vclob;
- Page 300 and 301:
Property Type Description Year Int3
- Page 302 and 303:
Hour : 8 Minute: 20 C:\work>c Arith
- Page 304 and 305:
Method Description Compare(IfxDec1,
- Page 306 and 307:
C:\work>decimal Value Sales Tax : 0
- Page 308 and 309:
Ceiling Sales Tax : 1.0 Negative Sa
- Page 310 and 311:
Visual Studio Add-In provides tools
- Page 312 and 313:
9.1 Informix and PHP extensions The
- Page 314 and 315:
- Console mode Enter one of the fol
- Page 316 and 317:
9.2.4 Verifying connectivity You ca
- Page 318 and 319:
► Secure Although PHP is open sou
- Page 320 and 321:
*--- persistent connect trusted use
- Page 322 and 323:
In a web application, the input dat
- Page 324 and 325:
Dynamic SQL statements Dynamic SQL
- Page 326 and 327:
$stmt->bindValue(':p9', $_POST["pho
- Page 328 and 329:
*--- Verification ---*/ $stmt1=$dbc
- Page 330 and 331:
$row=$stmt1->fetch(PDO::FETCH_ASSOC
- Page 332 and 333:
} /*--- Get the BLOB from the datab
- Page 334 and 335:
In Example 9-17 on page 316, the da
- Page 336 and 337:
Function Description db2_bind_param
- Page 338 and 339:
The IBM_DB2 extension This PHP exte
- Page 340 and 341:
9.3.5 Exception handling Error hand
- Page 342 and 343:
The error information that is gener
- Page 344 and 345:
9.3.6 Troubleshooting printf("NonCr
- Page 346 and 347:
10.1 An overview of UDRs and databa
- Page 348 and 349:
10.1.2 About UDRs specific examples
- Page 350 and 351:
Invoking a UDR You can invoke a UDR
- Page 352 and 353:
10.2 Developing UDRs To develop a U
- Page 354 and 355:
One variable in, one result out For
- Page 356 and 357:
10.2.2 UDRs in Java 5 1005 6 1006 7
- Page 358 and 359:
Note: The paths for .jar files that
- Page 360 and 361:
We use the following procedure to c
- Page 362 and 363:
For our example, JVPCLASSPATH is se
- Page 364 and 365:
10.2.3 UDRs in C and break somethin
- Page 366 and 367:
3. Set the bld file permissions as
- Page 368 and 369:
4. Create the function in dbaccess.
- Page 370 and 371:
Installing the DataBlade Any DataBl
- Page 372 and 373:
To connect to a database, run one o
- Page 374 and 375:
IBM Informix DataBlade module name
- Page 376 and 377:
interface, called BladeSmith, allow
- Page 378 and 379:
11.1 A brief overview of Ruby on Ra
- Page 380 and 381:
The following drivers allow Ruby to
- Page 382 and 383:
Data types The Ruby Informix driver
- Page 384 and 385:
03/07/2010 17:30 1,088 LICENSE 03/0
- Page 386 and 387:
The Rails Adapter can be installed
- Page 388 and 389:
server: demo_on username: informix
- Page 390 and 391:
Using Ruby Informix driver In this
- Page 392 and 393:
If the SQL statement returns only o
- Page 394 and 395:
Example 11-17 shows how to select a
- Page 396 and 397:
Example 11-19 shows a simple Ruby s
- Page 398 and 399:
# create a prepare object stmt = IB
- Page 400 and 401:
11.4 Using the Rails Adapter with R
- Page 402 and 403:
For more information, refer to: htt
- Page 404 and 405:
388 IBM Informix Developer’s Hand
- Page 406 and 407:
Figure 11-1 shows the Listing items
- Page 408 and 409:
11.5.1 Creating the Rails applicati
- Page 410 and 411:
11.5.4 Migrating the model Ruby on
- Page 412 and 413:
11.5.5 Starting the Rails web serve
- Page 414 and 415:
398 IBM Informix Developer’s Hand
- Page 416 and 417:
12.1 Basic concepts In this section
- Page 418 and 419:
A web service can perform the follo
- Page 420 and 421:
Example 12-1 shows a typical shell
- Page 422 and 423:
12.3.2 The w4gl utility For additio
- Page 424 and 425:
Parameter Description ws_func Funct
- Page 426 and 427:
In the remaining sections, we descr
- Page 428 and 429:
Example 12-8 shows the APP SERVER f
- Page 430 and 431:
Add details about the web service Y
- Page 432 and 433:
Source file information Finally, yo
- Page 434 and 435:
The Generate operation creates the
- Page 436 and 437:
process, running each individual st
- Page 438 and 439:
The compressed file is left in the
- Page 440 and 441:
Figure 12-3 shows the WSDL informat
- Page 442 and 443:
| Target Directory [/work/publish ]
- Page 444 and 445:
After this process is complete, the
- Page 446 and 447:
while using one of the I4GL web ser
- Page 448 and 449:
Keeping the wrapper C files in the
- Page 450 and 451:
12.6.2 Tracing A developer can use
- Page 452 and 453:
436 IBM Informix Developer’s Hand
- Page 454 and 455:
13.1 Concurrency and locking 13.1.1
- Page 456 and 457:
13.1.2 Lock duration The length of
- Page 458 and 459:
If a table is not created with row
- Page 460 and 461:
How the database server manages byt
- Page 462 and 463:
13.2.1 Deadlocks reader can read a
- Page 464 and 465:
ow that has not been committed (thi
- Page 466 and 467:
should check with the DBA to determ
- Page 468 and 469:
Note: For information about writing
- Page 470 and 471:
The amount of memory storage per lo
- Page 472 and 473:
The DIRECTIVES parameter The DIRECT
- Page 474 and 475:
13.5 Working with your database adm
- Page 476 and 477:
► Metadata updates affect logging
- Page 478 and 479:
Guidelines for setting VPCLASS: ►
- Page 480 and 481:
The lock level is determined by the
- Page 482 and 483:
466 IBM Informix Developer’s Hand
- Page 484 and 485:
area of specific interest. The func
- Page 486 and 487:
B.1 Distributed transactions A tran
- Page 488 and 489:
* Compile with: * on UNIX systems:
- Page 490 and 491:
} { printf("XA_PREPARE failed with
- Page 492 and 493:
When using distributed transactions
- Page 494 and 495:
478 IBM Informix Developer’s Hand
- Page 496 and 497:
Online resources ► IBM Informix D
- Page 498 and 499:
cast function 332 cast support func
- Page 500 and 501:
IfxDecimal public method 287 ifxdot
- Page 502 and 503:
jvpjavavm 341 jvplog 347 jvplogfile
- Page 504 and 505:
sql_longvarbinary 80, 96 sql_longva
- Page 506 and 507:
490 IBM Informix Developer’s Hand
- Page 510:
IBM Informix Developer’s Handbook