For configuration purposes, using properties file is a good way of reusing. In this way, when the code is packaged to a jar file, users can just put the different configurations in the config.properties file, instead of recompile the application.
MySQL (mysql-connector-java-5.0.5.jar) drivers should be put into lib directory and added to the project build path. Make sure you are using the correct version of the java drivers according to your database server installation version.
Your application will read the database configuration details from the property files, so that it can easily switch from Oracle to MySQL database and vice versa, just by changing the property details.
<b>#mysql DB properties
</b>#DB_DRIVER_CLASS=com.mysql.jdbc.Driver#DB_URL=jdbc:mysql://localhost:3306/UserDB#DB_USERNAME=pankaj#DB_PASSWORD=pankaj123
<b>#Oracle DB Properties
</b>DB_DRIVER_CLASS=oracle.jdbc.driver.OracleDriverDB_URL=jdbc:oracle:thin:@localhost:1571:MyDBSIDDB_USERNAME=scottDB_PASSWORD=tiger
<host>
<port>
<schema>
<host>
<port>
<sid>
</sid>
</port>
</host>
</schema>
</port>
</host>
Not at all
helpful Not much
helpful Some what
helpful Very
helpful Extremely
helpful | ||||||||
What could be better? (Optional)
X
Not related to my issue
Too complicated explanations
Too much information
Incorrect information
Unclear information
Incomplete information
Too old information
Do you have any other feedback about this faq ? 1000
|