Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while geting data from MS Access(Too few parameters Required 1)

 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Problem is solved as i made a mistake while creating the MS Access Database where the column name is different from what i have given in Statement
 
Paul Clapham
Sheriff
Posts: 21542
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's right. That message can mean that a table name isn't the name of any table in the database, or it can mean that a column name isn't the name of any column in the table. Not a very helpful message as I think you would agree!
 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But when I try Select * from table name and try to print them using result set it returns a no data found exception.
 
Paul Clapham
Sheriff
Posts: 21542
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And is that a question? If so then (just as in your original post) it would be helpful (i.e. essential) to see both the code and the error message.
 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Paul Clapham
Sheriff
Posts: 21542
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you were assuming that error message meant that no records were returned? That's a tempting guess if you don't look closely at the stack trace and observe that it's the getString() method which throws the exception, not the executeQuery() method.

And that's because the JDBC-ODBC driver doesn't like it when you try to get the same column twice from the same record. I'm guessing it's the second call to getString() which throws the exception, you can confirm that in your code. Do you really have to use that driver? There are better JDBC drivers than that one (namely all other JDBC drivers).
 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Paul Clapham for your reply.

Can you please tell me the others drivers through which i can access MS Access Database.As you quoted the sentence as "There are better JDBC drivers than that one (namely all other JDBC drivers)."
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HXTT comes to mind.
 
Paul Clapham
Sheriff
Posts: 21542
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
satheesh Valluru wrote:Can you please tell me the others drivers through which i can access MS Access Database.As you quoted the sentence as "There are better JDBC drivers than that one (namely all other JDBC drivers)."


I see you are running this code in a servlet environment. So you should be choosing a database which is designed for simultaneous access by many clients -- in other words, not MS Access. Which means I didn't word that correctly -- it's your choice of database which is the real problem, not your choice of JDBC driver.
 
satheesh Valluru
Greenhorn
Posts: 15
Android Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul Clapham

The Problem is solved by removing this line.

Thanks for the solution.
Actually I am developing a project as a part of my case study in My System itself that's why I am using MS Access as my Database.
Once again thank you for the Continuous support
 
Paul Clapham
Sheriff
Posts: 21542
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah well, if it's just a case study then it might be okay. As long as you don't expect it to be it turned into a production application next month. I've heard too many stories about management evaluating a prototype application, approving it, and expecting it to be put into production tomorrow. Telling them that you have to go back and fix up the prototype by removing all the shortcuts and quick-and-dirty code you put into it doesn't always sit well with management people.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic