private short try_connect_mysql()
	{
		MsgDumperCmnDef.WriteDebugSyslog(__FILE__(), __LINE__(), "Try to connect to the MySQL database server...");
		try 
		{
// Java要連接資料庫時，需使用到JDBC-Driver，連接MySQL資料庫使用Connector/j，下載後解開壓縮，mysql-connector-java-5.1.15-bin.jar就是MySQL的JDBC-Driver了.
// Go to http://blog.yslifes.com/archives/918 for more detailed info
// JDBC API is a Java API that can access any kind of tabular data, especially data stored in a Relational Database. 
// JDBC works with Java on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
// Go to http://www.tutorialspoint.com/jdbc/index.htm to see the example of MySQL command by JDBC
//註冊driver
			Class.forName("com.mysql.jdbc.Driver");
//jdbc:mysql://localhost/test?useUnicode=true&amp;characterEncoding=Big5: localhost是主機名, test是database名, useUnicode=true&amp;characterEncoding=Big5使用的編碼
			connection = DriverManager.getConnection(String.format("jdbc:mysql://localhost/%s?useUnicode=true&amp;characterEncoding=Big5", database), username, password);
		}
		catch(ClassNotFoundException ex)
		{
			String errmsg = "DriverClassNotFound:" + ex.toString();
			MsgDumperCmnDef.WriteErrorSyslog(__FILE__(), __LINE__(), errmsg);
			if (!silent_mode)
				System.out.println(errmsg);
			return MsgDumperCmnDef.MSG_DUMPER_FAILURE_MYSQL;
		}
		catch(SQLException ex) //有可能會產生sql exception
		{
			MsgDumperCmnDef.WriteDebugFormatSyslog(__FILE__(), __LINE__(), "The %s database does NOT exist, create a NEW one", database);
			try
			{
				connection = DriverManager.getConnection(String.format("jdbc:mysql://localhost/?user=%s&password=%s", username, password)); 
				Statement s = connection.createStatement();
				cmd_buf = String.format(format_cmd_create_database, database);
				MsgDumperCmnDef.WriteDebugFormatSyslog(__FILE__(), __LINE__(), "Try to create database[%s] by command: %s", database, cmd_buf);
				s.executeUpdate(cmd_buf);
			}
			catch(SQLException ex1) //有可能會產生sql exception
			{
				String errmsg = "Exception:" + ex1.toString();
				MsgDumperCmnDef.WriteErrorSyslog(__FILE__(), __LINE__(), errmsg);
				if (!silent_mode)
					System.out.println(errmsg);
				return MsgDumperCmnDef.MSG_DUMPER_FAILURE_MYSQL;
			}
			MsgDumperCmnDef.WriteDebugSyslog(__FILE__(), __LINE__(), "Try to connect to the MySQL database server...... Successfully");
		}

		return MsgDumperCmnDef.MSG_DUMPER_SUCCESS;
	}