-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the package structure of the project
- Loading branch information
1 parent
9e10be9
commit 45edd52
Showing
19 changed files
with
152 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target/ | ||
/build/ | ||
/target/ | ||
/build/ | ||
.classpath | ||
.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | ||
|
||
|
||
<wb-module deploy-name="onlinebookstore"> | ||
|
||
|
||
<wb-module deploy-name="onlinebookstore-0.0.1-SNAPSHOT"> | ||
|
||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> | ||
|
||
|
||
|
||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/> | ||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | ||
|
||
<property name="context-root" value="onlinebookstore"/> | ||
|
||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | ||
|
||
|
||
<property name="java-output-path" value="/onlinebookstore/build/classes"/> | ||
</wb-module> | ||
<property name="context-root" value="onlinebookstore"/> | ||
|
||
</wb-module> | ||
|
||
|
||
</project-modules> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package config; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DriverManager; | ||
import java.sql.SQLException; | ||
|
||
public class DBConnection { | ||
private static Connection con; | ||
|
||
private DBConnection() { | ||
}; | ||
|
||
static { | ||
|
||
try { | ||
|
||
Class.forName(DatabaseConfig.DRIVER_NAME); | ||
|
||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
try { | ||
|
||
con = DriverManager.getConnection(DatabaseConfig.CONNECTION_STRING, DatabaseConfig.DB_USER_NAME, | ||
DatabaseConfig.DB_PASSWORD); | ||
|
||
} catch (SQLException e) { | ||
|
||
e.printStackTrace(); | ||
|
||
} | ||
|
||
}// End of static block | ||
|
||
public static Connection getCon() { | ||
return con; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package config; | ||
|
||
public class DatabaseConfig { | ||
|
||
public static final String DRIVER_NAME ="com.mysql.jdbc.Driver"; | ||
public static final String DB_HOST = "jdbc:mysql://localhost"; | ||
public static final String DB_PORT = "3306"; | ||
public static final String DB_NAME = "onlinebookstore"; | ||
public static final String DB_USER_NAME = "root"; | ||
public static final String DB_PASSWORD = "root"; | ||
|
||
public static final String CONNECTION_STRING = DB_HOST + ":" + DB_PORT + "/" + DB_NAME; | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
.../constants/IOnlineBookStoreConstants.java → ...in/java/constants/BookStoreConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/main/java/sql/IBookConstants.java → ...n/java/constants/db/BooksDBConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/sql/IUserContants.java → ...n/java/constants/db/UsersDBConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.