[resolved] No data found java exception

One Star

[resolved] No data found java exception

hi all,
i am using a ODBC generic connexion on a hyperfileSQL classic database files to extract data. it works well on lots of tables of the same kind but when i get to this one, all its fields get selected and retrieved ok except one. if i add it to the query i get this error
Exception in component tDBInput_1
java.sql.SQLException: No data found
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(Unknown Source)
at tests.test_0_1.test.tDBInput_1Process(test.java:729)
at tests.test_0_1.test.runJobInTOS(test.java:1014)
at tests.test_0_1.test.main(test.java:934)

the data stored in this field is of type string (varchar or char) and consist of a max of 10 different values, i cant see why i get this
PS : i am using talend 3.0.4

Accepted Solutions
One Star

Re: [resolved] No data found java exception

im sorry sabrina i meant to write java's ResultSet,
by the way i did some debuging and found out how to solve this issue, i dont know exactly what the problem is, but for some reason the hyperfile odbc driver can't retrieve empty string data from that table in particular (i guess its not a talend issue but hyperfilesql's) , so i just added a where clause in the query to avoid that and it all works fine Smiley Happy)
SELECT arbitrary_field, the_said_field FROM the_said_table WHERE the_said_field!=''

i can't use IS NOT NULL because when its emplty its not identified as null
good day
UPDATE : The issue was that i was using a hyperfileSQL ODBC driver more recent than the database files so i reverted from ODBC 17 to 15 and that problem disappeared

All Replies
Moderator

Re: [resolved] No data found java exception

Hi,
Did you use SQL query in tDBinput component? If so, can your execute it in hyperfileSQL classic database successfully?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] No data found java exception

Hi sabrina, i did in fact try the same query and various variations of it on other tools by windev like the HyperfileSQL control center or the WDSQL using direct connexion to the fic file or the ODBC connexion i use in talend, and both give the expected results and get all my data.
ive seen elsewhere that the exeption i get is because somehow the java code try to read the code twice from the dataset
http://stackoverflow.com/questions/10197733/no-data-found-java-exception
is this relevant to my situation ?
Moderator

Re: [resolved] No data found java exception

Hi,
Not sure it refer to " read the code twice from the dataset". Could you please paste your SQL query in forum so that I can address your issue quickly.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] No data found java exception

im sorry sabrina i meant to write java's ResultSet,
by the way i did some debuging and found out how to solve this issue, i dont know exactly what the problem is, but for some reason the hyperfile odbc driver can't retrieve empty string data from that table in particular (i guess its not a talend issue but hyperfilesql's) , so i just added a where clause in the query to avoid that and it all works fine Smiley Happy)
SELECT arbitrary_field, the_said_field FROM the_said_table WHERE the_said_field!=''

i can't use IS NOT NULL because when its emplty its not identified as null
good day
UPDATE : The issue was that i was using a hyperfileSQL ODBC driver more recent than the database files so i reverted from ODBC 17 to 15 and that problem disappeared
Moderator

Re: [resolved] No data found java exception

Hi,
Thanks for your feedback and sharing your experience , it is very useful for us.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.