-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: java.lang.NumberFormatException: For input string — column i
PostPosted: Tue Apr 08, 2014 7:10 pm 
Newbie

Joined: Fri Apr 30, 2010 5:17 pm
Posts: 13
I am getting the following error:

Code:
java.lang.NumberFormatException: For input string: "approved"


The problem is that the approved column is a boolean in my database, or so I believe. Here is how I have it defined.

Code:
+----------+---------------+------+-----+---------+----------------+
| Field    | Type          | Null | Key | Default | Extra          |
+----------+---------------+------+-----+---------+----------------+
| approved | tinyint(4)    | YES  |     | NULL    |                |
+----------+---------------+------+-----+---------+----------------+


This is the line in my code where I'm defining the call to the database.

Code:
Query myQuery = session.createSQLQuery("select * from bulletins where approved = true");


Here is how I have it defined in my model class.

Code:
@Column(name="approved")
private boolean approved;


I've tried printing out the list in my controller class, and I get the following error.

Code:
[Ljava.lang.Object; cannot be cast to com.model.Bulletin


Top
 Profile  
 
 Post subject: Re: java.lang.NumberFormatException: For input string — column i
PostPosted: Wed Apr 09, 2014 8:41 pm 
Newbie

Joined: Fri Apr 30, 2010 5:17 pm
Posts: 13
I've got a different problem now, so don't bother with this thread.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.