How to resolve "data exception: invalid character value for cast" in java?

I am creating an application in which I am using Access database. I have to insert a few values in the database but I get an error "data exception: invalid character value for cast". I cant figure out whats wrong. Here is the code:

String sql = "INSERT INTO PATIENT (MRNumber, Address, Age, Gender, Contact, CNIC, Consultant, PatientName, FatherName) " + "Values ('ABC124', 'Billi', 'Billa', 'Rafa', 21, 'Female', '123', '34343', 'Baba')";
    cnnct.connect();
    try {
        cnnct.rs = cnnct.statement.executeQuery(sql);
        //while (cnnct.rs.next()) {

        //}
    }
    catch (Exception e) {
        System.out.println(e);
    }

Connect is a class where I have created the ResultSet, statement and connection objects. I am calling them here by using Connect class's object.

And this is an image of the database: enter image description here

Jon Skeet
people
quotationmark

Your values are in a different order to the columns you've specified, basically. You're trying to populate:

MRNumber: 'ABC124'
Address: 'Billi'
Age: 'Billa'
Gender: 'Rafa'
Contact: 21
CNIC: 'Female'
Consultant: '123'
PatientName: '34343'
FatherName: 'Baba'

I suspect it's trying to convert 'Billa' to a numeric Age value that's causing the immediate exception... but basically you need to specify the columns and values in the same order.

people

See more on this question at Stackoverflow