Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  Buy Now
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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 Xin Tian Tai Ltd. of Beijing City (abbr, HXTT)

Linux file issue
Kevin Berry
2005-09-28 00:00:00.0
I have written code to do an access export the code works properly on my windows machine for testing, but when I move it over to our Phedora linux machine the code does not work. We belive the problem has something to do with stripping the leading '\' of the database file path when opening it with jdbc you can see this issue in the following log statements.

2005-09-28 13:38:52,406 [DEBUG] com.peerplace.jobengine.JobEngine (#304) Class Created
2005-09-28 13:38:52,408 [DEBUG] com.peerplace.aging.reporting.EldersourceExport (#98) filename= AccessExport-1127929132408.mdb
2005-09-28 13:38:52,410 [DEBUG] com.peerplace.aging.reporting.EldersourceExport (#99) databasepath /opt/jboss-4.0.1/server/all/deploy/peerplace.war/pdffiles///repository//reports//AccessExport-1127929132408.mdb
2005-09-28 13:38:52,412 [DEBUG] com.peerplace.aging.reporting.EldersourceExport (#100) templateDB= /opt/jboss-4.0.1/server/all/deploy/peerplace.war/pdffiles///reports//eldersourceexport//Eldersource_Access_Export.mdb
2005-09-28 13:38:52,423 [DEBUG] com.peerplace.aging.reporting.EldersourceExport (#105) About to transferto databasepath /opt/jboss-4.0.1/server/all/deploy/peerplace.war/pdffiles///repository//reports//AccessExport-1127929132408.mdb
2005-09-28 13:38:52,535 [ERROR] com.peerplace.jobengine.JobEngine (#414) SQLException-->
2005-09-28 13:38:52,536 [ERROR] com.peerplace.jobengine.JobEngine (#415) opt/jboss-4.0.1/server/all/deploy/peerplace.war/pdffiles/repository/reports/AccessExport-1127929132408.mdb doesn't exist!
java.sql.SQLException: opt/jboss-4.0.1/server/all/deploy/peerplace.war/pdffiles/repository/reports/AccessExport-1127929132408.mdb doesn't exist!
at Source)
at com.hxtt.sql.access.j.if(Unknown Source)
at com.hxtt.sql.access.j.(Unknown Source)
at com.hxtt.sql.access.EmbeddedDriver.connect(Unknown Source)
at Source)
at com.hxtt.sql.HxttDriver.a(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at com.peerplace.reporting.AccessExport.createAccessConn(
at com.peerplace.reporting.AccessExport.createReport(
at com.peerplace.reporting.AccessExport.createReport(
at com.peerplace.jobengine.JobEngine.processCannedReport(
at com.peerplace.jobengine.JobEngine.processJob(
at com.peerplace.jobengine.JobEngine.startEngine(
at com.peerplace.jobengine.JobEngine.main(
2005-09-28 13:38:52,603 [DEBUG] com.peerplace.jobengine.JobEngine (#163) setJobErrorState
2005-09-28 13:38:52,606 [DEBUG] com.peerplace.jobengine.JobEngine (#146) setJobID: 0
2005-09-28 13:38:52,607 [DEBUG] com.peerplace.jobengine.JobEngine (#551) Processed 0 jobs.
2005-09-28 13:38:52,608 [DEBUG] com.peerplace.jobengine.JobEngine (#552) 1 jobs where set to Error State.

as you can see the line at '2005-09-28 13:38:52,423' displays the path of the mdb('/opt/jboss-4.0.1/...') and the sql error opening on line at '2005-09-28 13:38:52,536' prints the path as '/opt/jboss-4.0.1/...' I believe this may be the issue. Here is the doe used as well.

String filename = "AccessExport-" + ( new Long( (new Date()).getTime() ) ).toString() + ".mdb";
this.databasePath = systemDir + filename;

log.debug("filename= "+ filename);
log.debug("databasepath "+ this.databasePath);
log.debug("templateDB= "+ templateDB);
File templateFile = new File(templateDB);
File outputFile = new File(databasePath);
FileChannel in = new FileInputStream(templateFile).getChannel();
FileChannel out = new FileOutputStream(outputFile).getChannel();
log.debug("About to transferto databasepath "+ this.databasePath);

in.transferTo( 0, in.size(), out);

Connection result = DriverManager.getConnection("jdbc:Access:/" + databasePath);

Any help will be greatly appreciated.
Re:Linux file issue
Kevin Berry
2005-09-28 00:00:00.0
error occurs on line:

Connection result = DriverManager.getConnection("jdbc:Access:/" + databasePath);
Re:Re:Re:Linux file issue
HXTT Support
2005-09-28 00:00:00.0
>Connection result = DriverManager.getConnection("jdbc:Access:/" + databasePath);
Connection result = DriverManager.getConnection("jdbc:Access:///" + databasePath);

Good luck:)
Re:Re:Re:Re:Linux file issue
HXTT Support
2005-09-28 00:00:00.0
That url will work on Windows and Linux:)

Search Key   Search by Last 50 Questions


Copyright © 1999-2017 Heng Xin Tian Tai Ltd. of Beijing City. | All Rights Reserved. | Privacy | Legal | Sitemap