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

HXTT ACCESS
Analista de Sistemas
Cleverson Sacramento
2006-01-23 00:00:00.0
When I try to execute the following query on Microsoft Access, just 1 row is returned. But when I try to execute on HXTT JDBC Access Driver, no row is returned!!!

select *
from Funcionarios f
where f.CodigoFuncionario = ?
and f.CodigoEmpresa = ?


When I delete the last line, 1 row is returned:

select *
from Funcionarios f
where f.CodigoFuncionario = ?


I tried exhaustingly execute the query wihout PreparedStatement setting the parameters manually, but the problem persists.

select *
from Funcionarios f
where f.CodigoFuncionario = 3309061
and f.CodigoEmpresa = 33



The original code is the following:

/**
* Prepara o solicitante para a emissão de um Boletim de Ocorrencia.
* @param solicitante Solicitante do BO.
* @throws br.com.netra.j2fw.exception.NetraException Exceção padrão.
*/
public void preparaSolicitante(Funcionario solicitante)
throws NetraException {
try {
StringBuffer sb = new StringBuffer();
sb.append(" select * ");
sb.append(" from Funcionarios f ");
sb.append(" where f.CodigoFuncionario = ? ");
sb.append(" and f.CodigoEmpresa = ? ");

Connection conn = this.getConnection();
PreparedStatement st = conn.prepareStatement(sb.toString());

int i = 1;
DBParser.set(st, i++, new Long(solicitante.getMatricula()));
DBParser.set(st, i++, ConstanteDAO.RBTEMPO_COD_EMPRESA);

ResultSet rs = st.executeQuery();


if (!rs.next()) {

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

throw new ValidacaoException(ConstanteDAO.MENSAGEM_VALIDACAO_NENHUM_REGISTRO);
}

rs.close();
st.close();
conn.close();
} catch (Throwable cause) {
this.trataExcecao(cause);
}
}


I am having problems in Production Environment. How to decide the problem? The previous driver version presents problem the same? I am using version Access JDBC 3.0 Package 2006-01-18 07:52.
Re: No rows returned
Cleverson Sacramento
2006-01-24 00:00:00.0
I get a new Access JDBC 3.0 Package, revision 2006-01-23 11:36, but a problem continues.

My access version is 97. The definition of columns is: CodigoFuncionario double; CodigoEmpresa long integer. The PreparedStatement parameters are java.lang.Long and java.lang.Long respectively. Already I also tried java.lang.Double and java.lang.Long respectively, but the problem continues.

My string conection is the following:
jdbc:access:/t:/db/rbtempo.mdb

Necessary of aid urgently.
Re:Re:Analista de Sistemas
HXTT Support
2006-01-24 00:00:00.0
>My access version is 97. The definition of columns is: CodigoFuncionario double; CodigoEmpresa long integer.
You should have index on CodigoEmpresa column, but HXTT Access failed to use index to find that row because your index should have some corrupted information. You can try Repair and Compact once your rbtempo.mdb in MS Access, then HXTT Access should work normally again for your application.
Re:Re:Re: No rows returned
Cleverson Sacramento
2006-01-24 00:00:00.0
I repaired and compacted my rbtempo.mdb, but the problem persists. The problem occurs when i use both restrictions simultaneously, in other words its no index problem.

I converted the rbtempo.mdb for 2000 version, then it gave successfull.
Re:Re:Re:Re:Analista de Sistemas
HXTT Support
2006-01-24 00:00:00.0
It should be an index issue. If possible, you can email webmaster@hxtt.com that Access 97 rbtempo.mdb .
Re:Re:Re:Re:Re: No rows returned
Cleverson Sacramento
2006-01-24 00:00:00.0
I sent the rbtempo.mdb to webmaster@hxtt.com. I wait a reply anxiously!
Re:Re:Re:Re:Re:Re:Analista de Sistemas
HXTT Support
2006-01-24 00:00:00.0
Thanks for your sample. Found MS Access 97 has used compression index sometimes. Supported. Please download the latest package.
Re:Re:Re:Re:Re:Re:Re: ArrayIndexOutOfBoundsException
Cleverson Sacramento
2006-01-24 00:00:00.0
Now the SELECT works, but the UPDATE throws a ArrayIndexOutOfBoundsException.

Follows the code-source:

/**
* Justifica a falta do funcion��rio atualizando o sistema RB-TEMPO.
* @param dto Recebe o dto para atualizar a base do RB-TEMPO ap��s ter sido
* executado o m��todo preparaApontamento.
* @return
* @throws br.com.netra.j2fw.exception.NetraException
*/
public Serializable criar(AbstractDTO dto) throws NetraException {
try {
BoletimOcorrencia bo = (BoletimOcorrencia) dto;

StringBuffer sb = new StringBuffer();
sb.append(" update apontamento set ");
sb.append(" justificativa = ?, ");
sb.append(" obs = ? ");
sb.append(" where codigofuncionario = ? ");
sb.append(" and codigoempresa = ? ");
sb.append(" and dataapontamento = ? ");

Iterator iter = bo.getApontamentos().iterator();

while (iter.hasNext()) {
BoletimOcorrenciaApontamento apontamento = (BoletimOcorrenciaApontamento) iter.next();

Connection conn = this.getConnection();
PreparedStatement st = conn.prepareStatement(sb.toString());

int i = 1;
DBParser.set(st, i++, bo.getJustificativa().getCodigo());
DBParser.set(st, i++, bo.getJustificativa().getDescricao());
DBParser.set(st, i++,
new Long(bo.getSolicitante().getMatricula()));
DBParser.set(st, i++, ConstanteDAO.RBTEMPO_COD_EMPRESA);
DBParser.set(st, i++, apontamento.getHorario().getData());

if (st.executeUpdate() == 0) {
throw new ValidacaoException(ConstanteDAO.MENSAGEM_VALIDACAO_NENHUM_REGISTRO);
}

st.close();
conn.close();
}
} catch (Throwable cause) {
cause.printStackTrace();
this.trataExcecao(cause);
}

return null;
}


Follows the exception:

06/01/24 14:59:05 java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
06/01/24 14:59:05 at com.hxtt.global.SQLState.SQLException(Unknown Source)
06/01/24 14:59:05 at com.hxtt.sql.a7.a(Unknown Source)
06/01/24 14:59:05 at com.hxtt.sql.y.a(Unknown Source)
06/01/24 14:59:05 at com.hxtt.sql.cm.char(Unknown Source)
06/01/24 14:59:05 at com.hxtt.sql.cm.executeUpdate(Unknown Source)
06/01/24 14:59:05 at com.evermind.sql.FilterPreparedStatement.executeUpdate(FilterPreparedStatement.java:240)
06/01/24 14:59:05 at com.evermind.sql.FilterPreparedStatement.executeUpdate(FilterPreparedStatement.java:240)
06/01/24 14:59:05 at com.evermind.sql.FilterPreparedStatement.executeUpdate(FilterPreparedStatement.java:240)
06/01/24 14:59:05 at br.gov.ba.bahiatursa.wf.dao.BoletimOcorrenciaDAO.criar(BoletimOcorrenciaDAO.java:279)


The expression works when I execute directly on Microsoft Access:

update apontamento set
justificativa = 'AE'
obs = 'ABONO ENTRADA'
where codigofuncionario = 3309061
and codigoempresa = 33
and dataapontamento = #01/16/2006#


Execute this to see the modified data:

select * from apontamento
where codigofuncionario = 3309061
and codigoempresa = 33
and dataapontamento = #01/16/2006#


Execute this to return to original values:

update apontamento set
justificativa = null,
obs = null
where codigofuncionario = 3309061
and codigoempresa = 33
and dataapontamento = #01/16/2006#


And now?
Re:Re:Re:Re:Re:Re:Re:Re:Analista de Sistemas
HXTT Support
2006-01-24 00:00:00.0
Recurred and supported. Now the compression index format of MS Access 97 has been supported fully. Please download the latest package.

>#01/16/2006#
In sql, you should use '2006-01-16', '2006/01/16', or {d '2006-01-16'}.
Re:Re:Re:Re:Re:Re:Re:Re:Analista de Sistemas
Cleverson Sacramento
2006-01-25 00:00:00.0
Now its okay. Thanks.

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