在jb中添加进test.ini就没问题了。

解决方案 »

  1.   

    添加了,然后程序是这样的
    InputStream ins = new FileInputStream("DBConnString.ini");可是找不到文件?还需要做什么?
      

  2.   

    这个例子看看有没有用:
    Properties prop = new Properties();try {
    InputStream is = getClass().getResourceAsStream("db.properties");
    prop.load(is);
    if( is != null ) is.close();
    } catch (IOException e) {
    System.out.println("[DbConnection] 打开文件时出现错误");
    }String jdbc = prop.getProperty("driver");
    String url = prop.getProperty("url");
    String user = prop.getProperty("user");
    String password = prop.getProperty("password");
      

  3.   

    to RobinHZ(熊掌):
    请问你的db.properties是放在什么文件夹?