读取resources资源文件

public synchronized static String getSqlString(String strKey)
{
    //资源文件的包名.文件名
    ResourceBundle  sqlResourceBundle = ResourceBundle.getBundle("resouces.sql_en", loc);
        
    if (null == strKey || ("".equals(strKey)) || (null == sqlResourceBundle))
    {
        return null;
    }
    String strTemp = null;
        
    try
    {
        strTemp = sqlResourceBundle.getString(strKey);
    }
    catch (Exception e)
    {
        strTemp = strKey;
    }
    return strTemp;
}

你可能感兴趣的:(java,sql)