package com.bll.mysql;
import java.io.InputStream;
import java.util.Properties;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
try {
InputStream res= App.class.getClassLoader().getResourceAsStream("1.txt");
Properties prop = new Properties();
prop.load(res);
String string = prop.getProperty("className");
System.out.println(string);
} catch (Exception e) {
// TODO: handle exception
}
System.out.println( "Hello World!" );
}
}
1.txt内容
className = com.mysql.jdbc.Driver
url=jdbc:mysql