Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help!! ResultSet error

 
yashko yashko
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
help! I get an Unexpected Exception: java.lang.ArrayIndexOutOfBoundsException message given: 65603 on the line rs=stmt.executeQuery(sqlString). where sqlString="SELECT * from <table>". The table that I query has a column that is of "text" type. my database is MySQL.
what's the problem with this? is it the jdbc driver that i use?
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Send the full code
 
yashko yashko
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection conn = DBConnnector.getConnection();
Statement stmt=conn.createStatement();
String sql="SELECT * from article";
ResultSet rs;
try{
rs=stmt.executeQuery(sql);
}catch(Exception ex){
ex.printStackTrace();
}
/*********************************
Sorry, but this is only what I can show. DBConnector
is a class where I get the Connection to the database.
My database is MySQL. In the table article, I have a
column of "text" type.The actual code is very much like
this. The exception was thrown at rs=stmt.executeQuery(sql);
*********************************/
 
sandesh bangera
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
have you tried running this code by seleting just a single column from the your table.
try this out and see if you code can handle this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65653
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"yashko yashko",
We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Thanks!
bear
Forum Bartender
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!