Description:
hello! I am creating a dynamic web project using eclipse
and using embedded derby
database. Below is the code that i am using to connect/create embedded derby database.
private boolean connect() throws Exception{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String dbURL = "jdbc:derby:codejava/webdb;create=true";
Connection conn = DriverManager.getConnection(dbURL);
if (conn != null) {
return true;
}else{
return false;
}
}
Problem:
When i run the code first time it creates the database
but when i check the application folder in webapps
folder in tomcat
, i found no database folder. Tomcat folder is in my C:/ Directory
and searching the C:/ directory i found the database folder in my eclipse folder because that's where i start my IDE from if i am not wrong.
Question:
How can i create the database folder inside my application folder in tomcat/webapps
folder?