Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
HxttConnectionPoolDataSource
Andrey Fedotov
2005-06-17 00:00:00.0
Hello!

I have a question regarding using HxttConnectionPoolDataSource. My url to the database is "jdbc:dbf:/c:/dbffiles". By unfortunaly there's no HxttConnectionPoolDataSource constructor with passing url as an input parameter.
I have to use java.util.Properties as an input parameter to the HxttConnectionPoolDataSource constructor - but I didn't find any documentation where the format of Properties file for HxttConnectionPoolDataSource is described...
I'd be very grateful if you write me the format of this properties...

Now I'm trying
Properties DbfProp = new Properties();
DbfProp.setProperty("c:/dbffiles"); // or DbfProp.setProperty("jdbc:dbf:/c:/dbffiles");

com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);

But every time I get such exception: urlPrefix can't be null!

Thank you very much for supporting!
HxttConnectionPoolDataSource (2)
Andrey Fedotov
2005-06-17 00:00:00.0
I've solved it this way:

String DbfDBPath = "c:/dbfdata"
DbfProp.setProperty("urlPrefix", "jdbc:DBF:/"+DbfDBPath);
DbfProp.setProperty("database", "dbf");

so that all table are stored in c:/dbfdata/dbf.

Now I have one more question and want to get the answer on it from you.

I want to set some additional properties like
charSet and Version Number.
Adding them to the properties that are passed to the constuctor of HxttConnectionPoolDataSource doing no effect.
for example,
DbfProp.setProperty("charSet", "Cp866"); // or DbfProp.setProperty("connectionProperties", "charSet=Cp866");
com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);

I don't have Cp866 encoding in my dbf files...
Any solutions? Please help me as soon as it's possible...

Thanks a lot!
HxttConnectionPoolDataSource (3)
Andrey Fedotov
2005-06-17 00:00:00.0
And I also want to add "Version Number","3"...
Re:Re:Re:HxttConnectionPoolDataSource
HXTT Support
2005-06-18 00:00:00.0
Dear Andrey Fedotov,

> By unfortunaly there's no HxttConnectionPoolDataSource
> constructor with passing url as an input parameter.
You can use:
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");

> DbfProp.setProperty "urlPrefix", "jdbc:DBF:/"+DbfDBPath);
Unnecessary in the latest package.
> DbfProp.setProperty("database", "dbf");
Correct, but you can miss that property if you has already used url property.

> And I also want to add "Version Number","3"...
You can use DbfProp.setProperty("versionNumber", "3");

> DbfProp.setProperty("charSet", "Cp866");
> I don't have Cp866 encoding in my dbf files...
Correct if you wish to use Cp866 to encoding/decoding your text data.

BTW, you can use:
com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);
dbfcpds.setCharSet("Cp866");
dbfcpds.setUrl("jdbc:dbf:/c:/dbffiles");
...
PooledConnection pooledConnection=dbfcpds.getPooledConnection();

With best regards,

Dai Wei



Re:Re:Re:Re:HxttConnectionPoolDataSource
Andrey Fedotov
2005-06-18 00:00:00.0
Dai Wei, thank you very much for such full and quick answer!
It's the best one I've ever recieved from Support team of a software product!
Is
dbfcpds.setCharSet("Cp866");
dbfcpds.setUrl("jdbc:dbf:/c:/dbffiles");
suitable for your JDBC driver version 2.0? And if I use such way of setting ConnPoolDataSourse what parameters I should set to ConnPoolDataSourse constructor?

Thank you one more time!
Re:Re:Re:Re:Re:HxttConnectionPoolDataSource
HXTT Support
2005-06-18 00:00:00.0
Dear Andrey Fedotov,

> Is dbfcpds.setCharSet("Cp866");
> dbfcpds.setUrl("jdbc:dbf:/c:/dbffiles");
> suitable for your JDBC driver version 2.0?
Yeah. But you need JDBC2.0 extension package (jdbc2_0-stdext.jar) if you're using JDK1.2.X . For JDK1.3.X, JDK1.4.X, and JDK1.5.X, you can use DBF JDBC 3.0 package or DBF JDBC 2.0 package.

> And if I use such way of setting
> ConnPoolDataSourse what parameters
> I should set to ConnPoolDataSourse constructor?
Properties DbfProp = new Properties();
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");
DbfProp.setProperty("charSet", "Cp866");
com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);
...
PooledConnection pooledConnection=dbfcpds.getPooledConnection();
...


Re:Re:Re:Re:Re:Re:HxttConnectionPoolDataSource
Andrey Fedotov
2005-06-21 00:00:00.0
Dear Dai Wei!

During the testing of solutions that you advised me I've found some problems:

First of all, I haven't found methods (!!!) setCharSet and setUrl in com.hxtt.sql.HxttConnectionPoolDataSource class (I use DBF JDBC 2.0 package).
DbfProp.setProperty("charSet", "Cp866");
DbfProp.setProperty("versionNumber", "3");
makes no effect - the resulting dbf file isn't with encoding Cp866 and isn't versionNumber=3 (is 30 by default).
Please help me to resolve this problem because it's really important to me and I haven't found any solutions in documentation or in the web...

Second, using
Properties DbfProp = new Properties();
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");
DbfProp.setProperty("charSet", "Cp866");
com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);
causing java.lang.Exception: urlPrefix can't be null! (as I described above I have to use
DbfProp.setProperty("urlPrefix", "jdbc:dbf:/");
DbfProp.setProperty("database", "dbffiles");
instead of
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");
to avoid this exception.
The second part isn't important for me now (because I've found the answer), so please consider of the first part...

Thanks again for you attention!
Re:Re:Re:Re:Re:Re:HxttConnectionPoolDataSource
Andrey Fedotov
2005-06-21 00:00:00.0
Dear Dai Wei!

During the testing of solutions that you advised me I've found some problems:

First of all, I haven't found methods (!!!) setCharSet and setUrl in com.hxtt.sql.HxttConnectionPoolDataSource class (I use DBF JDBC 2.0 package).
DbfProp.setProperty("charSet", "Cp866");
DbfProp.setProperty("versionNumber", "3");
makes no effect - the resulting dbf file isn't with encoding Cp866 and isn't versionNumber=3 (is 30 by default).
Please help me to resolve this problem because it's really important to me and I haven't found any solutions in documentation or in the web...

Second, using
Properties DbfProp = new Properties();
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");
DbfProp.setProperty("charSet", "Cp866");
com.hxtt.sql.HxttConnectionPoolDataSource dbfcpds = new com.hxtt.sql.HxttConnectionPoolDataSource(DbfProp);
causing java.lang.Exception: urlPrefix can't be null! (as I described above I have to use
DbfProp.setProperty("urlPrefix", "jdbc:dbf:/");
DbfProp.setProperty("database", "dbffiles");
instead of
DbfProp.setProperty("url", "jdbc:dbf:/c:/dbffiles");
to avoid this exception.
The second part isn't important for me now (because I've found the answer), so please consider of the first part...

Thanks again for you attention!
Re:Re:Re:Re:Re:Re:Re:HxttConnectionPoolDataSource
HXTT Support
2005-06-21 00:00:00.0
Dear Andrey Fedotov,

> First of all, I haven't found methods (!!!) setCharSet and setUrl in
> com.hxtt.sql.HxttConnectionPoolDataSource class (I use DBF JDBC 2.0 package).
>causing java.lang.Exception: urlPrefix can't be null!
Those mean that you're using a very older package. Please visit www.hxtt.net to download a latest package, which supports url property. If you make sure you are using the latest package, please search all DBF_JDBC20.jar files on your computer, and remove all older files.

>DbfProp.setProperty("charSet", "Cp866");
>DbfProp.setProperty("versionNumber", "3");
With those properties, all new table through CREATE TABLE sql in that connection should be compatible with older DBASE and FOXPRO applications, with Cp866 charset.

With best regards,

Dai Wei

Search Key   Search by Last 50 Questions




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap