我现在在看个程序,driverUrl = System.getProperty("db.url"),String oracleUserName = System.getProperty("user.name");String oraclePassword = System.getProperty("user.password");连接数据库的属性在system这个类中设的连接数据库的属性,但是我在这个类中没有找到,我不知道怎么设,有谁告诉我设的方法?谢谢,很急,在线等,谢谢!

解决方案 »

  1.   

    Properties properties = new Properties();
    properties.load(new FileInputStream("etc/weather.conf"));tring URL          = "jdbc:oracle:thin:@" + properties.getProperty("OracleAlarmPosition");
    String user         = properties.getProperty("OracleAlarmUsername");
    String password   = properties.getProperty("OracleAlarmPassword");
      

  2.   

    cuizm(射天狼),这几天公司网络断了没有上网,不好意思啊,请再个问题啊好吗?properties.load(new FileInputStream("etc/weather.conf"));连数据库属性是在
    weather.conf文件中设的吗?怎么设呢?还有OracleAlarmPosition这个名字是不是配置文件中已有?
    我的环境是在JRUN4.0下,但是好象没有找到这个文件啊,小弟才学JAVA,有许多不懂请多多指教,谢谢.
      

  3.   

    properties.load(new FileInputStream("etc/weather.conf")),etc/weather.conf这个路径在哪个设的?谢谢.