public static Connection getConnectionDB() {
		File dbDir = new File(CoreContext.DB_DATA_PATH);
		if (!dbDir.exists()) dbDir.mkdir();
		Connection connection = null;
		try {
			// если базы нет, то она будет создана автоматически,
			// иначе будет создано подключение к существующей базе
			connection = DriverManager.getConnection(
					"jdbc:hsqldb:file:" + dbDir.getPath() + File.separator
							+ CoreContext.DB_LIBRARY_FILE_NAME, "SA", "");
		} catch (SQLException e) {
			// TODO change to log
			System.err.println("ERROR: failed to create connection with db");
			e.printStackTrace();
			// TODO change System.exit(1)
			System.exit(1);
		}
		// TODO version db
//		SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(
//				new File(dbDir, CoreContext.DB_LIBRARY_FILE_NAME), null);
//
//		if (db.getVersion() != version) {
//			db.beginTransaction();
//			try {
//				int currVersion = db.getVersion();
//				if (currVersion == 0) {
//					onCreate(db);
//				};
//				onUpgrade(db, currVersion);
//				db.setVersion(version);
//				db.setTransactionSuccessful();
//			} finally {
//				db.endTransaction();
//			}
//		}
		return connection;
	}
public static Connection getConnectionDB() {
		File dbDir = new File(CoreContext.DB_DATA_PATH);
		if (!dbDir.exists()) dbDir.mkdir();
		Connection connection = null;
		try {
		
					"jdbc:hsqldb:file:" + dbDir.getPath() + File.separator
							+ CoreContext.DB_LIBRARY_FILE_NAME, "SA", "");
		} catch (SQLException e) {
		
			System.err.println("ERROR: failed to create connection with db");
			e.printStackTrace();
		
			System.exit(1);
		}
	
		return connection;
	}
public static connection getconnectiondb() { file dbdir = new file(corecontext.db_data_path); if (!dbdir.exists()) dbdir.mkdir(); connection connection = null; try { "jdbc:hsqldb:file:" + dbdir.getpath() + file.separator + corecontext.db_library_file_name, "sa", ""); } catch (sqlexception e) { system.err.println("error: failed to create connection with db"); e.printstacktrace(); system.exit(1); } return connection; }