WSAD5.1 Data Stem: How to Access Informx723 (Online) Data Source Articles
JK325 (z95888@yahoo.com.cn)
I. Working environment and the required software: Informix Sever: Test DB Server for SCO UNIX INFORMIX 723 Online JDBC Driver: JDBC.2.21.jc5.tar WSAD: WIN 2000 WSAD5.1 2, Create Steps:
Step 1: Get the DB Server necessary parameters, the test samples are as follows: ServerName Online (ONLINE should define the IP of the Win2000 HOSTS) Port 4700 DatabaseName BST2000 USER ORACLE Password JK325
Step 1: Test the connection parameters, verify that the DB Server works properly, and whether the parameters have correctly created a new enterprise application ------ CCB is selected in the perspective panel ---- Data perspective (Figure)
New connection:
Connection parameters:
Note: Difference between the host (h) and the server name in the desired parameters: The server name (Online) is defined in the / etc / sqlhosts file in the DB Server directory. Its value can be obtained from DBA. If all parameters are correct, the connection is successful. The table structure in the library will be poured into the WSAD. Step 2: Create a data source: Select in the perspective panel ---- Service Perspective Double-click the server instance name. Sample Hello
Select "Security" to create Jaas
Where username, password is a USER / Password alias for accessing the database: Data User User Name: Oracle Password: JK325
Select the "Data Source" column
Add Informix Driver
Create a driver name: Informix
Specify class path: Note that $ {informix_jdb_driver_path} is ambient variable in the above image, and the specific setting is in the option "Variable" column, the node defines a part. Find the corresponding variable and add the actual drive installation path.
Next, create a new data source:
Select V5 Specify Name in Creating Data Source dialog: Test JNDI: JDBC / MYDS Component Management, Container Management: Select the Data User created in JaAs;
Create a resource property:
DatabaseName: BST2000 Servername: Online Port: 4700 ifxifxhost 192.168.120.101
Create a data source.
Step 3: Test data source:
It is necessary to build a table DEV_MSG with its Field Node
Create a new JSP page. The content is as follows:
<% @ page language = "java" contenttype = "text / html; charset = GBK" PageEncoding = "GBK" import = "javax.naming. *, java.sql. *, javax.sql. *"%> <%
Javax.sql.datasource DS = NULL;
Java.sql.connection con = NULL;
ResultSet RST = NULL;
Statement Stmt = NULL;
Try {
Out.println ("" is looking for data source
");
Javax.naming.initialcontext ctx = new javax.naming.initialContext ();
DS = (javax.sql.datasource) CTX.lookup ("JDBC / MYDS");
Out.println ("Connected Data Source
");
CON = ds.getConnection ();
String SQL = "SELECT NODE from DEV_MSG";
STMT = con.createstatement ();
RST = Stmt.executeQuery (SQL);
String Note = ""
IF (Rst.Next ()) {
Note = RST.GETSTRING (1);
}
Out.println (Note);
Rst.close ();
Stmt.close ();
C. close ();
} catch (exception e) {
System.out.println (E.getMessage ());
}
Out.println ("Complete
");
%>
p>
Body>
Html>
Step 4: Error encountered: 79746 No Transaction Isolation on non-logging DB's Informix Does Not Support Setting The Transaction Isolation Level On Non-logging Databases. Solution: Change the BST2000 Database Log Mode as DBA: Ontape -S -B BST2000 can be. (Finish)