how to write a mysql_database.property file in classpath using netbeans and java!!! not to able to access it
test_database.jdbc.url = jdbc:mysql://localhost:3306/test_database
test_database.jdbc.driver = com.mysql.jdbc.开发者_运维百科Driver
test_database.jdbc.username = username
test_database.jdbc.password = password
new > other > other > Properties file
so plz can anyone teach me how to write the poperties file in correct classpath and access them...
as i wrote the above in my property file its not working... Actually i dont how to place the properties file in classpath
Thanks for ur time...
Place the properties file at the root folder of your source/class files. So if you have a class
com.example.MyClass
then the file structure could be like that:
./com/example/MyClass.class
./db.properties
Now db.properties
is definitly on the classpath.
精彩评论