Get the initial DB properties (null means no properties).
@param objDatabaseParam database specific parameter (ie., for jdbc this is the db name)
@return The initial properties.
178165
public Map<String,String> getDatabaseProperties()
    {
        String strDatabaseProductName = this.getProperty(SQLParams.INTERNAL_DB_NAME);
        if (strDatabaseProductName == null)
            return null;    // Can't get the properties without the database being used
        Map<String,String> map = super.getDatabaseProperties();        
        strDatabaseProductName = strDatabaseProductName.toLowerCase();
        ResourceBundle dbProperties = null;
        if (strDatabaseProductName.indexOf("access") != -1)
            dbProperties = new DBProperties_access();
        else if (strDatabaseProductName.indexOf("instantdb") != -1)
            dbProperties = new DBProperties_instantdb();
        else if (strDatabaseProductName.indexOf("sybase") != -1)
            dbProperties = new DBProperties_sybase();
        else if (strDatabaseProductName.indexOf("pointBase") != -1)
            dbProperties = new DBProperties_pointbase();
        else if (strDatabaseProductName.indexOf("mysql") != -1)
            dbProperties = new DBProperties_mysql();
        else if (strDatabaseProductName.indexOf("postgresql") != -1)
            dbProperties = new DBProperties_postgresql();
        else
        {
            if (strDatabaseProductName.indexOf('.') == -1)
            {
                String strClassName = DBProperties_mysql.class.getName();
                strDatabaseProductName = strClassName.substring(0, strClassName.length() - "mysql".length()) + strDatabaseProductName;
            }
//            dbProperties = (ListResourceBundle)ThinUtil.getClassService().makeObjectFromClassName(Object.class.getName(), strDatabaseProductName);

            
            
           try {
        	   Class<?> c = Class.forName(strDatabaseProductName);
        	   dbProperties = (ListResourceBundle)c.newInstance();
           } catch (Exception e) {
    		   Utility.getLogger().warning("Error on create class: " + strDatabaseProductName);
    		   e.printStackTrace();
           }
           
        }
        // Merge the properties with my properties.
        if (dbProperties != null)
        {
            if (map == null)
                map = new HashMap<String,String>();
            for (Enumeration<String> e = dbProperties.getKeys() ; e.hasMoreElements() ;)
            {
                String key = e.nextElement();
                String value = dbProperties.getString(key);
                map.put(key, value);
            }
        }
        
        return map;
    }
1300028
public void init(DatabaseOwner databaseOwner, String strDbName, int iDatabaseType, Map<String, Object> properties)
    {
        super.init(databaseOwner, strDbName, iDatabaseType, properties);

        if ((iDatabaseType & Constants.REMOTE_MEMORY) == 0)
        {   // Usually don't send messages (unless this is a remote copy, then I would)
            this.setProperty(DBParams.MESSAGES_TO_REMOTE, DBConstants.FALSE);   // Send by server version
            this.setProperty(DBParams.CREATE_REMOTE_FILTER, DBConstants.FALSE); // Create the remote filter
            this.setProperty(DBParams.UPDATE_REMOTE_FILTER, DBConstants.FALSE); // Updated by server version
        }
    }
177480
public PreparedStatementSetter getParameters() {
		if (list.size() == 0) {
			return null;
		}
		PreparedStatementSetter param = new PreparedStatementSetter() {
			@Override
			public void setValues(PreparedStatement pstmt) {
				try {
					StatementParameter.this.setValues(pstmt);
				}
				catch (SQLException e) {
					throw new InvalidParamDataAccessException(e);
				}
			}

		};
		return param;
	}
763990
public ThinPhysicalDatabaseParent getPDatabaseParent(Map<String,Object> properties, boolean bCreateIfNew)
    {
        if (m_PhysicalDatabaseParent == null)
            if (bCreateIfNew)
        {
            Map<String,Object> map = new Hashtable<String,Object>();
            if (properties != null)
                map.putAll(properties);
            if (map.get(PhysicalDatabaseParent.APP) == null)
                map.put(PhysicalDatabaseParent.APP, this); // Access to the server, etc.
            
            m_PhysicalDatabaseParent = (ThinPhysicalDatabaseParent)ClassServiceUtility.getClassService().makeObjectFromClassName(Constants.ROOT_PACKAGE + "thin.base.db.mem.base.PhysicalDatabaseParent");
            if (m_PhysicalDatabaseParent != null)
                m_PhysicalDatabaseParent.init(map);  // Init
        }
        if (properties != null)
        {
            for (String strKey : properties.keySet())
            {
                m_PhysicalDatabaseParent.setProperty(strKey, properties.get(strKey));
            }
        }
        return m_PhysicalDatabaseParent;
    }
395285
private static Properties initProperties() {
		InputStream stream = null;
		try {
			// TODO: limited to known drivers, better find driver later based on JDBC connection URL without "simon" word
			Properties properties = new Properties();
			stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("org/javasimon/jdbc4/drivers.properties");
			if (stream != null) {
				properties.load(stream);
			}
			return properties;
		} catch (IOException e) {
			throw new IllegalStateException(e);
		} finally {
			if (stream != null) {
				try {
					stream.close();
				} catch (IOException e) {
					// Doesn't matter
				}
			}
		}
	}
903197
public DatabaseSession getDatabaseSession(BaseDatabase database)
    {
        for (int iFieldSeq = 0; iFieldSeq < this.getSessionObjectCount(); iFieldSeq++)
        {   // See if any of my children want to handle this command
            if (this.getSessionObjectAt(iFieldSeq).getDatabaseSession(database) != null)
                return this.getSessionObjectAt(iFieldSeq).getDatabaseSession(database);
        }
        return null;    // Not found
    }
1163054
private DbDatum[] get_obj_property(Database database, String name, String type, String[] propnames)
            throws DevFailed {
        if (!database.isAccess_checked()) checkAccess(database);

        //	Format input parameters as string array
        //--------------------------------------------
        String[] array;
        array = new String[1 + propnames.length];
        array[0] = name;
        System.arraycopy(propnames, 0, array, 1, propnames.length);

        //	Buid command name (depends on object type)
        //---------------------------------------------------
        String cmd = "DbGet" + type + "Property";

        //	Read Database
        //---------------------
        DeviceData argIn = new DeviceData();
        argIn.insert(array);
        DeviceData argOut = command_inout(database, cmd, argIn);
        String[] result = argOut.extractStringArray();

        //	And convert to DbDatum array before returning
        //-------------------------------------------------
        return stringArray2DbDatum(result);
    }
988090
private JdbcType lookupJdbcType()
    {
        JdbcType result = null;
        String columnType = getColumnType();
        // if sql type was not set in metadata we use reflection
        // to determine sql type by reflection
        if (columnType == null)
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByReflection(m_PersistentField.getType().getName());
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't automatically assign a jdbc field-type for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        else
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByName(columnType);
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't assign the specified jdbc field-type '"+columnType+"' for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        return result;
    }
236252
public Map<String, Object> getDBProperties() throws DBException, RemoteException
    {
        BaseTransport transport = this.createProxyTransport(GET_DB_PROPERTIES);
        Object strReturn = transport.sendMessageAndGetReply();
        Object objReturn = transport.convertReturnObject(strReturn);
        return (Map)this.checkDBException(objReturn);
    }
498704
private DbDatum[] stringArray2DbDatum(String[] strprop) {
        //	And format result as DbDatum array
        //---------------------------------------
        DbDatum[] properties;
        int nb_prop = Integer.parseInt(strprop[1]);
        properties = new DbDatum[nb_prop];

        //	Skip obj name, nb prop found and name of first property.
        //-----------------------------------------------------------
        for (int i = 2, pnum = 0 ; i<strprop.length - 1 ; ) {
            int nb = Integer.parseInt(strprop[i + 1]);

            //	if property exist, create Datnum object.
            //---------------------------------------------------
            int start_val = i + 2;
            int end_val = i + 2 + nb;
            if (nb>0)
                properties[pnum++] = new DbDatum(strprop[i],
                        strprop, start_val, end_val);
            else {
                //	no property  --> fields do not exist
                properties[pnum++] = new DbDatum(strprop[i]);

                //	If nb property is zero there is a property
                //	set to space char (!!!)
                //	if Object is device it is true but false for a class !!!
                //----------------------------------------------------------
                if (start_val + 1<strprop.length) {
                    String s = strprop[start_val];
                    if (s.length()==0 || s.equals(" "))
                        end_val = start_val + 1;
                }
            }
            i = end_val;
        }
        return properties;
    }
392190
public String getDatabaseName(String databaseKey) {

        return getDatabaseProperties().get(databaseKey).getProperty(databaseKey + PROPKEY_NAME);
    }
513187
public static RuntimeDatabase getRuntimeDatabase() {
        final String runtimeDatabase = getLocalProperty("runtimeDatabase");
        if (null == runtimeDatabase) {
            throw new RuntimeException("Please configures runtime database in local.properties!");
        }

        final RuntimeDatabase ret = RuntimeDatabase.valueOf(runtimeDatabase);
        if (null == ret) {
            throw new RuntimeException("Please configures a valid runtime database in local.properties!");
        }

        return ret;
    }
1247796
public static Map<String, Object> getProperties(Object obj) {
		Map<String, Object> map = new HashMap<String, Object>();

		Class<?> objClass = obj.getClass();

		// Get all fields
		for (Field field : objClass.getFields()) {
			try {
				if (matchField(field, field.getName())) {
					String name = field.getName();
					Object value = field.get(obj);
					map.put(name, value);
				}
			} catch (Throwable t) {
				// Ignore exception
			}
		}

		// Get all properties
		for (Method method : objClass.getMethods()) {
			try {
				if (method.getName().startsWith("get") && matchPropertyGetter(method, method.getName())) {
					String name = method.getName().substring(3);
					name = name.substring(0, 1).toLowerCase() + name.substring(1);
					Object value = method.invoke(obj);
					map.put(name, value);
				}
			} catch (Throwable t) {
				// Ignore exception
			}
		}

		return map;
	}
582971
public int doMergeData(Object objData)
    {
        int iErrorCode = DBConstants.NORMAL_RETURN;
        FieldListener nextListener = (FieldListener)this.getNextListener();
        if (nextListener != null)
            iErrorCode = nextListener.doMergeData(objData);
        else if (m_owner != null)
            iErrorCode = this.getOwner().doMergeData(objData);
        return iErrorCode;
    }
395524
public java.util.List<DBParameterGroupStatus> getDBParameterGroups() {
        if (dBParameterGroups == null) {
            dBParameterGroups = new com.amazonaws.internal.SdkInternalList<DBParameterGroupStatus>();
        }
        return dBParameterGroups;
    }
776595
public DbDatum[] get_property(String name, DbDatum[] properties) throws DevFailed {
		return databaseDAO.get_property(this, name, properties);
	}
473752
@Override
	public Object toJdbc(final OptionalDouble original, final Connection connection,
			final BindParameterMapperManager parameterMapperManager) {
		return original.isPresent() ? original.getAsDouble() : null;
	}