`
piziyan
  • 浏览: 68241 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

读取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;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics