Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  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 Text(CSV)
Null Pointer Exception in HxttDataSource.getConnection().
Rodolfo Martin
2005-04-08 00:00:00.0
Hi,
First of all thank you for producing a fix to my problems so quick... But I have just downloaded the last package and had a problem getting a connection from a HxttDataSource.
I have a database.properties file with the following contents:
database=/my/database/path
fileExtension=hpi
subprotocol=text
schemaFile=schema.sql

The following code worked OK with the previous package.

HxttDataSource dataSource = null;
Connection hxttConn;
Properties props = new Properties();
try{
props.load(ClassLoader.getSystemResourceAsStream("database.properties");
dataSource = new HxttDataSource(props);
hxttConn = dataSource.getConnection();
Statement stmt = hxttConn.createStatement();
......
}catch(Exception e){
Tree.LOG.error(e);
logger.info(e,e);
}

Now throws a Null Pointer Exception calling dataSource.getConnection()
ERROR AWT-EventQueue-0 2005-04-08 13:44:36,151 java.lang.NullPointerException
java.lang.NullPointerException
at com.hxtt.sql.cd.createStatement(Unknown Source)
at com.hxtt.sql.cd.createStatement(Unknown Source)
at com.hxtt.sql.text.g.b(Unknown Source)
at com.hxtt.sql.text.g.(Unknown Source)
at com.hxtt.sql.text.DirectAccessDriver.connect(Unknown Source)
at com.hxtt.global.SQLState.getConnection(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at com.hxtt.sql.HxttDataSource.a(Unknown Source)
at com.hxtt.sql.HxttDataSource.getConnection(Unknown Source)
at com.hxtt.sql.HxttDataSource.getConnection(Unknown Source)
......

My schemaFile absolute path is /my/database/path/schema.sql and contents sql statements like these:
create table if not exists a0_configuracion (A0_CDETIQUETA VARCHAR(39), _StuffedColumn char(1) default ' ',A0_CDVALOR VARCHAR(80), _StuffedColumn char(1) default '\n');
create table if not exists gt4_subapns (GT4_NUSUBAPN NUMERIC(8, 0), _StuffedColumn char(1) default ' ',GT4_GT1_NUAPN NUMERIC(8, 0), _StuffedColumn char(1) default ' ',GT4_CDRED VARCHAR(16), _StuffedColumn char(1) default ' ',GT4_CDRANGODEDIRECCIONESIP VARCHAR(39), _StuffedColumn char(1) default ' ',GT4_T2_NUTIPODESTINO NUMERIC(4, 0), _StuffedColumn char(1) default '\n');
create table if not exists gtq_qos (GTQ_NUQOS NUMERIC(4, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_0 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_1 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_2 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_3 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_4 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_5 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_6 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_DSDESCRIPCION VARCHAR(100), _StuffedColumn char(1) default '\n');


I have tested with Admin and after opening a conection with jdbc:Text:////my/database/path and executing the statement:

create table if not exists gtq_qos (GTQ_NUQOS NUMERIC(4, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_0 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_1 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_2 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_3 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_4 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_5 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_NUQOS_6 NUMERIC(3, 0), _StuffedColumn char(1) default ' ',GTQ_DSDESCRIPCION VARCHAR(100), _StuffedColumn char(1) default '\n');

I can query a gtq_qos.BIN copy of gtq_qos.hpi table.

Best Regards.

Rodolfo Martin

Re:Null Pointer Exception in HxttDataSource.getConnection().
HXTT Support
2005-04-08 00:00:00.0
Dear Rodolfo,

Fixed. That's resulted by the code modification for transaction support. Now you can use the below setting too:
url=jdbc:text:////my/database/path
fileExtension=hpi
schemaFile=schema.sql

Then subprotocol and database can be calculated. Please download the latest package.
Re:Re:Null Pointer Exception in HxttDataSource.getConnection().
Rodolfo Martin
2005-04-11 00:00:00.0
Thank you very much,
It is working again.
Btw. I have recommended purchasing the product. I expect my company will put in contact with you soon.

Best Regards.

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