Verbindung variable nicht aufgelöst werden kann

public class GestorBase{

 public static void main(String[] args){
  try
  {
   Class.forName("org.sqlite.JDBC");
  }
  catch (ClassNotFoundException e) {
   System.out.println("Unable to load driver class");
   //TODO: handle exception
  }
  try {
   Connection con = DriverManager.getConnection("jdbc:sqlite:db/Freepark.sqlite");
  } catch (SQLException e) {
   //TODO Auto-generated catch block
   System.out.println("error al buscar la base de datos");
  }

  Statement sentencia = con.createStatement();


 }}

Eclipse sagt:

"con" - variable nicht aufgelöst werden zu einem Typ.

Warum?

InformationsquelleAutor Robert13 | 2010-12-03

Schreibe einen Kommentar