SQLite with netbeans not working

I am trying to add SQLite driver sqlitejdbc-v056.jar into my netbeans 7.1.2 project, I have created the database and everything without any problem but when I try to connect to the database with the below code (which I got online) it is not working

public static void main(String args[]) throws Exception {

    Connection conn = DriverManager.getConnection("jdbc:sqlite:Vinit");

    Statement stat = (Statement) conn.createStatement();
    stat.executeUpdate("drop table if exists school;");
    stat.executeUpdate("create table school (name, state);");
    PreparedStatement prep = conn.prepareStatement(
                             "insert into school values (?, ?);");

    prep.setString(1, "UTD");
    prep.setString(2, "texas");
    prep.setString(1, "USC");
    prep.setString(2, "california");
    prep.setString(1, "MIT");
    prep.setString(2, "massachusetts");


    ResultSet rs = stat.executeQuery("select * from school;");

    while (rs.next()) {
        System.out.print("Name of School = " + rs.getString("name") + " ");
        System.out.println("state = " + rs.getString("state"));


It is giving me a problem with stat.executeQuery giving the following error

cannot find symbol
symbol:   method executeQuery(java.lang.String)
location: variable stat of type java.beans.Statement

Does anyone know why this is happening?

EDIT: Imports

import java.beans.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

When I add import java.sql.Statement; it gives it an error and says to remove unused import


I have an array like below: PersonClass[] person= { new PersonClass("90234234434", "John", "Smith", 22, "Street 22/5", 10//this is priority from 0 up to 10), ... .....

There is a question about doubly linkedlist that I have been thinking for a while but still cannot get the answer. Suppose there are N elements in a doubly linkedlist. How many elements do we have to ...

After my research and discussion here I decided I need to set the same name for threads on different JVMs which belong to the same control flow in the distributed system. Threads are created e.g. by ...

I have made an application in which a JForm containing the JTextfields,JButtons. When I click a button I want to display the data of JTextfield in JTable. How can I do this anybody help me. I know how ...