Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v6.1
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT DBF
SCO Unix Compatibility
tony burgess
2006-03-23 00:00:00
We have been trying some code compiled under java 1.3 running on SCO unix and have been unsuccessful in retrieving any data.

We get the following output:
TestDBF.checkConnection
TestDBF.getConnection
sql1 = SELECT * from urglocal WHERE model='XXXX' and unique=1000 AND urgid='YY'
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JNIFile in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java, Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java:744)
at java.lang.System.loadLibrary(System.java:815)
at com.hxtt.concurrent.JNIFile.(Unknown Source)
at com.hxtt.concurrent.x.(Unknown Source)
at com.hxtt.concurrent.p.do(Unknown Source)
at com.hxtt.concurrent.p.if(Unknown Source)
at com.hxtt.concurrent.p.a(Unknown Source)
at com.hxtt.sql.dbf.i.null(Unknown Source)
at com.hxtt.sql.dbf.i.long(Unknown Source)
at com.hxtt.sql.dbf.d.a(Unknown Source)
at com.hxtt.sql.dbf.d.(Unknown Source)
at com.hxtt.sql.dbf.u.a(Unknown Source)
at com.hxtt.sql.be.if(Unknown Source)
at com.hxtt.sql.cv.a(Unknown Source)
at com.hxtt.sql.cv.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.be.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.a(Unknown Source)
at com.hxtt.sql.ab.executeQuery(Unknown Source)
at TestDBF.checkConnection(TestDBF.java, Compiled Code)
at TestDBF.(TestDBF.java:101)
at TestDBF.main(TestDBF.java:110)


TestClass:
public class TestDBF {

public static final String DBF_JDBC_DRIVER = "com.hxtt.sql.dbf.DBFDriver";
// public static final String DBF_JDBC_URL = "jdbc:dbf:/c:/fpd26";
public static final String DBF_JDBC_URL = "jdbc:dbf:////usr/tmp";

// For linux use e.g., "jdbc:dbf:////usr/tmp"
// For DOS use e.g., "jdbc:dbf:/c:/data"

private Properties props = new Properties();

/**
* get a database connection
*
* @return
*/
private Connection getConnection() {
System.out.println("TestDBF.getConnection");
Connection conn = null;
try {
Class.forName(DBF_JDBC_DRIVER);
props.setProperty("versionNumber", "F5");
props.setProperty("lockType", "FOXPRO");
conn = DriverManager.getConnection(DBF_JDBC_URL, props);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}


/**
* Check that we can get a connection with the DBF driver and
* use the driver to update, query and execute SQL's
*/
private void checkConnection() {
System.out.println("TestDBF.checkConnection");

Connection conn = getConnection();
try {
Statement st = conn.createStatement();
String sql1 = "SELECT * from urglocal WHERE model='XXXX' and unique=1000 AND urgid='YY'";
System.out.println("sql1 = " + sql1);
long now = System.currentTimeMillis();

ResultSet rs = st.executeQuery(sql1);
while (rs.next()) {
System.out.println(rs.getString("urgid"));
}

rs.close();

String sql2 = "UPDATE urglocal SET model='0625' WHERE unique=1000 AND urgid='YY'";
System.out.println("sql2 = " + sql2);
now = System.currentTimeMillis();
st.executeUpdate(sql2);
System.out.println("Time taken for update: " + (System.currentTimeMillis() - now));

sql2 = "INSERT INTO urglocal (model, urgid, unique) values ('XXXX', 'YY', 1000)";
System.out.println("sql2 = " + sql2);
now = System.currentTimeMillis();
st.executeUpdate(sql2);
System.out.println("Time taken for insert: " + (System.currentTimeMillis() - now));

st.close();
conn.close();

} catch (SQLException e) {
System.err.println(e);
SQLWarning warnings = null;
try {
warnings = conn.getWarnings();
int errorCode = warnings.getErrorCode();
String message = warnings.getMessage();
System.out.println("message = " + message);
System.out.println("errorCode = " + errorCode);
} catch (SQLException e1) {
System.out.println("errror 2 = " + e1);
}
}
}

/**
* Call the checkConnection method when the class is constructed
*/
public TestDBF() {
checkConnection();
}

/**
* Run the test
*
* @param args
*/
public static void main(String[] args) {
new TestDBF();
}


} // TestDBF

Any help or advice would be welcomed.


Tony Burgess
Actual Systems UK Ltd.
Re:SCO Unix Compatibility
HXTT Support
2006-03-23 00:00:00
1st solution:
>props.setProperty("lockType", "FOXPRO");
If you haven't any FOXPRO application on SCO unix, you can remove that lockType property, then your program can run normally.

2nd solution:
If you use JDK1.4.X, or JDK1.5.X, not JDK1.3.X,you needn't JNIFile library.

3rd solution:
>no JNIFile in java.library.path
You should download JNIFile.zip from http://www.hxtt.com/download.jsp?product=dbf. More detailed information is at Question 6:"You need download the JNIFile.dll ( or libJNIFile.so) from here, and add the JNIFile.dll ( or libJNIFile.so) into your library path. DBF driver will lock and unlock automatically when you execute SQL through DBF driver.".



Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap