stephenxero
Programmer
Dear all,
I have used the JDK1.3 and informix jdbc driver 2.11 for connecting the informix se 7.1. The java coding show as following,
==============start===========================
package myprojects.informixse;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import sqlj.runtime.ref.DefaultContext;
public class InformixSE {
public static void main(String args[]){
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String DRIVER = null ; //JDBC Driver class
String DBURL = null ; //Database URL
String UID = null ; //User ID for database account
String PWD = null ; //Password for database account
String cmd = null;
int rc;
try{
DRIVER = "com.informix.jdbc.IfxDriver";
DBURL = "jdbc:informix-sqli://192.168.1.30:30000:INFORMIXSERVER=test;user=informix;password=informix";
UID = "informix";
PWD = "informix";
Driver d = (Driver)(Class.forName( DRIVER ).newInstance());
DriverManager.registerDriver(d);
System.out.println("000"
conn = DriverManager.getConnection (DBURL, UID, PWD);
stmt = conn.createStatement();
String sql = "use test";
System.out.println("before run the sql"
rs = stmt.executeQuery(sql);
System.out.println("after run the sql"
System.out.println(conn);
//cmd="database test";
//rc = stmt.executeUpdate(cmd);
}
catch(Exception ee)
{
System.out.println(ee);
}
finally
{
try{
if(stmt != null)
stmt.close();
if(conn != null)
conn.close();
}catch(Exception e){
System.out.println(e);
}
}
}
}
============== end ===========================
When I run the coding, there is an error "java.sql.SQLException: ????????????????". Does anyone kindly to help me solve these issues? Is it relate to the database environment setting in informix??
Thanks,
StephenXero
I have used the JDK1.3 and informix jdbc driver 2.11 for connecting the informix se 7.1. The java coding show as following,
==============start===========================
package myprojects.informixse;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import sqlj.runtime.ref.DefaultContext;
public class InformixSE {
public static void main(String args[]){
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String DRIVER = null ; //JDBC Driver class
String DBURL = null ; //Database URL
String UID = null ; //User ID for database account
String PWD = null ; //Password for database account
String cmd = null;
int rc;
try{
DRIVER = "com.informix.jdbc.IfxDriver";
DBURL = "jdbc:informix-sqli://192.168.1.30:30000:INFORMIXSERVER=test;user=informix;password=informix";
UID = "informix";
PWD = "informix";
Driver d = (Driver)(Class.forName( DRIVER ).newInstance());
DriverManager.registerDriver(d);
System.out.println("000"
conn = DriverManager.getConnection (DBURL, UID, PWD);
stmt = conn.createStatement();
String sql = "use test";
System.out.println("before run the sql"
rs = stmt.executeQuery(sql);
System.out.println("after run the sql"
System.out.println(conn);
//cmd="database test";
//rc = stmt.executeUpdate(cmd);
}
catch(Exception ee)
{
System.out.println(ee);
}
finally
{
try{
if(stmt != null)
stmt.close();
if(conn != null)
conn.close();
}catch(Exception e){
System.out.println(e);
}
}
}
}
============== end ===========================
When I run the coding, there is an error "java.sql.SQLException: ????????????????". Does anyone kindly to help me solve these issues? Is it relate to the database environment setting in informix??
Thanks,
StephenXero