// Path: src/main/java/net/ucanaccess/util/Logger.java
// public class Logger {
// 	public enum Messages{
// 		HSQLDB_DRIVER_NOT_FOUND,
// 		COMPLEX_TYPE_UNSUPPORTED,
// 		KEEP_MIRROR_AND_OTHERS
// 	}
// 	private static PrintWriter logPrintWriter;  
// 	private static ResourceBundle messageBundle=ResourceBundle.getBundle("net.ucanaccess.util.messages");
// 	
// 	public static void dump() {
// 		StackTraceElement[] ste = Thread.currentThread().getStackTrace();
// 		for (StackTraceElement el : ste) {
// 			logPrintWriter.println(el.toString());
// 			logPrintWriter.flush();
// 		}
// 	}
// 	
// 	public static void turnOffJackcessLog(){
// 		java.util.logging.Logger logger = java.util.logging.Logger
// 		.getLogger("com.healthmarketscience.jackcess");
//          logger.setLevel(Level.OFF);
// 	}
// 	
// 	public static PrintWriter getLogPrintWriter() {
// 		return logPrintWriter;
// 	}
// 	
// 	public static String getMessage(String cod){
// 		return messageBundle.getString(cod);
// 	}
// 	
// 	public static void log(Object obj) {
// 		if (logPrintWriter != null){
// 			logPrintWriter.println(obj);
// 			logPrintWriter.flush();
// 		}
// 	}
// 	
// 	public static void  logMessage(Messages cod){
// 		log( messageBundle.getString(cod.name()));
// 	}
// 	
// 	public static String  getLogMessage(Messages cod){
// 		return messageBundle.getString(cod.name());
// 	}
// 	
// 	public static void  logWarning(String warning){
// 		System.err.println("WARNING:"+ warning);
// 	}
// 	public static void  logWarning(Messages cod){
// 		logWarning( messageBundle.getString(cod.name()));
// 	}
// 	
// 	public static void setLogPrintWriter(PrintWriter logPrintWriter) {
// 		Logger.logPrintWriter = logPrintWriter;
// 	}
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Map.Entry;
import net.ucanaccess.util.Logger;
import com.healthmarketscience.jackcess.Database;
import com.healthmarketscience.jackcess.DatabaseBuilder;
		try{
		db = DatabaseBuilder.open(fl);
	      }catch(IOException e){
	    	  DatabaseBuilder dbb=new  DatabaseBuilder();
	    	  dbb.setReadOnly(true);
		      db= dbb.open();
		
	    }
		String pwd = db.getDatabasePassword();
		db.close();
		return pwd != null;
	}
	
	private static void lcProperties(Properties pr) {
		Properties nb=new Properties();
		
		for( Entry<Object, Object> entry:pr.entrySet()){
			String key=(String)entry.getKey();
			if(key!=null){
				nb.put(key.toLowerCase(), entry.getValue());
			}
		}
		pr.clear();
		pr.putAll(nb);
	}
	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
// Path: src/main/java/net/ucanaccess/util/Logger.java
// public class Logger {
// 	public enum Messages{
// 		HSQLDB_DRIVER_NOT_FOUND,
// 		COMPLEX_TYPE_UNSUPPORTED,
// 		KEEP_MIRROR_AND_OTHERS
// 	}
// 	private static PrintWriter logPrintWriter;  
// 	private static ResourceBundle messageBundle=ResourceBundle.getBundle("net.ucanaccess.util.messages");
// 	
// 	public static void dump() {
// 		StackTraceElement[] ste = Thread.currentThread().getStackTrace();
// 		for (StackTraceElement el : ste) {
// 			logPrintWriter.println(el.toString());
// 			logPrintWriter.flush();
// 		}
// 	}
// 	
// 	public static void turnOffJackcessLog(){
// 		java.util.logging.Logger logger = java.util.logging.Logger
// 		.getLogger("com.healthmarketscience.jackcess");
//          logger.setLevel(Level.OFF);
// 	}
// 	
// 	public static PrintWriter getLogPrintWriter() {
// 		return logPrintWriter;
// 	}
// 	
// 	public static String getMessage(String cod){
// 		return messageBundle.getString(cod);
// 	}
// 	
// 	public static void log(Object obj) {
// 		if (logPrintWriter != null){
// 			logPrintWriter.println(obj);
// 			logPrintWriter.flush();
// 		}
// 	}
// 	
// 	public static void  logMessage(Messages cod){
// 		log( messageBundle.getString(cod.name()));
// 	}
// 	
// 	public static String  getLogMessage(Messages cod){
// 		return messageBundle.getString(cod.name());
// 	}
// 	
// 	public static void  logWarning(String warning){
// 		System.err.println("WARNING:"+ warning);
// 	}
// 	public static void  logWarning(Messages cod){
// 		logWarning( messageBundle.getString(cod.name()));
// 	}
// 	
// 	public static void setLogPrintWriter(PrintWriter logPrintWriter) {
// 		Logger.logPrintWriter = logPrintWriter;
// 	}
// }


// Path: src/main/java/net/ucanaccess/console/Main.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Map.Entry;
import net.ucanaccess.util.Logger;
import com.healthmarketscience.jackcess.Database;
import com.healthmarketscience.jackcess.DatabaseBuilder;

		try{
		db = DatabaseBuilder.open(fl);
	      }catch(IOException e){
	    	  DatabaseBuilder dbb=new  DatabaseBuilder();
	    	  dbb.setReadOnly(true);
		      db= dbb.open();
		
	    }
		String pwd = db.getDatabasePassword();
		db.close();
		return pwd != null;
	}
	
	private static void lcProperties(Properties pr) {
		Properties nb=new Properties();
		
		for( Entry<Object, Object> entry:pr.entrySet()){
			String key=(String)entry.getKey();
			if(key!=null){
				nb.put(key.toLowerCase(), entry.getValue());
			}
		}
		pr.clear();
		pr.putAll(nb);
	}
	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		Logger.setLogPrintWriter(new PrintWriter(System.out));