public short open_device()
	{
// Check if the connection is established
		if (connection == null)
		{
			MsgDumperCmnDef.WriteErrorFormatSyslog(__FILE__(), __LINE__(), "Thread[%s]=> The connection is NOT established", facility_name);
			return  MsgDumperCmnDef.MSG_DUMPER_FAILURE_MYSQL;
		}

		if (!table_created)
		{
// Get the current time
			current_time_string = generate_current_time_string();

// Create the table in the database...
			try
			{
				Statement s = connection.createStatement();
				cmd_buf = String.format(format_cmd_create_table, current_time_string);
				MsgDumperCmnDef.WriteDebugFormatSyslog(__FILE__(), __LINE__(), "Thread[%s]=> Try to create table[sql%s] by command: %s", facility_name, current_time_string, cmd_buf);

				s.executeUpdate(cmd_buf);
			}
			catch(SQLException ex) //有可能會產生sql exception
			{
				if (ex.getErrorCode() == 1050)
					MsgDumperCmnDef.WriteDebugFormatSyslog(__FILE__(), __LINE__(), "Thread[%s]=> The sql%s has already existed", facility_name, current_time_string);
				else
				{
					MsgDumperCmnDef.WriteErrorFormatSyslog(__FILE__(), __LINE__(), "Thread[%s]=> Fails to create table[sql%s], due to: %d, %s", facility_name, current_time_string, ex.getMessage());
					return MsgDumperCmnDef.MSG_DUMPER_FAILURE_MYSQL;
				}
			}			
			table_created = true;
		}

		return MsgDumperCmnDef.MSG_DUMPER_SUCCESS;
	}