Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Cobol v5.0
  HXTT DBF v7.1
  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 ACCESS
Linux file issue
Kevin Berry
2005-09-28 00:00:00
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 com.hxtt.global.SQLState.SQLException(Unknown 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 com.hxtt.global.SQLState.getConnection(Unknown Source)
at com.hxtt.sql.HxttDriver.a(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at com.peerplace.reporting.AccessExport.createAccessConn(AccessExport.java:110)
at com.peerplace.reporting.AccessExport.createReport(AccessExport.java:142)
at com.peerplace.reporting.AccessExport.createReport(AccessExport.java:170)
at com.peerplace.jobengine.JobEngine.processCannedReport(JobEngine.java:305)
at com.peerplace.jobengine.JobEngine.processJob(JobEngine.java:496)
at com.peerplace.jobengine.JobEngine.startEngine(JobEngine.java:540)
at com.peerplace.jobengine.JobEngine.main(JobEngine.java:605)
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);

Class.forName("com.hxtt.sql.access.AccessDriver");
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
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
>Connection result = DriverManager.getConnection("jdbc:Access:/" + databasePath);
Try:
Connection result = DriverManager.getConnection("jdbc:Access:///" + databasePath);

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

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