diff options
| -rw-r--r-- | .classpath | 18 | ||||
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | .project | 31 | ||||
| -rw-r--r-- | .settings/.jsdtscope | 12 | ||||
| -rw-r--r-- | .settings/org.eclipse.jdt.core.prefs | 7 | ||||
| -rw-r--r-- | .settings/org.eclipse.wst.common.component | 8 | ||||
| -rw-r--r-- | .settings/org.eclipse.wst.common.project.facet.core.xml | 9 | ||||
| -rw-r--r-- | .settings/org.eclipse.wst.jsdt.ui.superType.container | 1 | ||||
| -rw-r--r-- | .settings/org.eclipse.wst.jsdt.ui.superType.name | 1 | ||||
| -rw-r--r-- | libs/mysql-connector-java-8.0.15.jar | bin | 0 -> 2134905 bytes | |||
| -rw-r--r-- | src/main/java/pokemon/Database.java | 30 | ||||
| -rw-r--r-- | src/main/webapp/META-INF/MANIFEST.MF | 3 | ||||
| -rw-r--r-- | src/main/webapp/WEB-INF/web.xml | 12 | ||||
| -rw-r--r-- | src/main/webapp/index.jsp | 21 | 
14 files changed, 155 insertions, 0 deletions
diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..3c82a2b --- /dev/null +++ b/.classpath @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> +	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> +		<attributes> +			<attribute name="module" value="true"/> +		</attributes> +	</classpathentry> +	<classpathentry kind="src" path="src/main/java"/> +	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> +	<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> +	<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/apache-tomcat-9.0.65"/> +	<classpathentry kind="lib" path="libs/mysql-connector-java-8.0.15.jar"> +		<attributes> +			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> +		</attributes> +	</classpathentry> +	<classpathentry kind="output" path="build/classes"/> +</classpath> diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e31d94d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/build/ +apache-tomcat-9.0.65/ diff --git a/.project b/.project new file mode 100644 index 0000000..770ab72 --- /dev/null +++ b/.project @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> +	<name>ImiPokemon</name> +	<comment></comment> +	<projects> +	</projects> +	<buildSpec> +		<buildCommand> +			<name>org.eclipse.jdt.core.javabuilder</name> +			<arguments> +			</arguments> +		</buildCommand> +		<buildCommand> +			<name>org.eclipse.wst.common.project.facet.core.builder</name> +			<arguments> +			</arguments> +		</buildCommand> +		<buildCommand> +			<name>org.eclipse.wst.validation.validationbuilder</name> +			<arguments> +			</arguments> +		</buildCommand> +	</buildSpec> +	<natures> +		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> +		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> +		<nature>org.eclipse.wst.common.project.facet.core.nature</nature> +		<nature>org.eclipse.jdt.core.javanature</nature> +		<nature>org.eclipse.wst.jsdt.core.jsNature</nature> +	</natures> +</projectDescription> diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..76c2d63 --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> +	<classpathentry excluding="**/node_modules/*|**/*.min.js|**/bower_components/*" kind="src" path="src/main/webapp"/> +	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> +	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> +		<attributes> +			<attribute name="hide" value="true"/> +		</attributes> +	</classpathentry> +	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> +	<classpathentry kind="output" path=""/> +</classpath> diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c537b63 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..17d5dc5 --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> +    <wb-module deploy-name="ImiPokemon"> +        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> +        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> +        <property name="context-root" value="ImiPokemon"/> +        <property name="java-output-path" value="/ImiPokemon/build/classes"/> +    </wb-module> +</project-modules> diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..611d2df --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<faceted-project> +  <fixed facet="jst.web"/> +  <fixed facet="wst.jsdt.web"/> +  <fixed facet="java"/> +  <installed facet="java" version="1.6"/> +  <installed facet="jst.web" version="3.0"/> +  <installed facet="wst.jsdt.web" version="1.0"/> +</faceted-project> diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window
\ No newline at end of file diff --git a/libs/mysql-connector-java-8.0.15.jar b/libs/mysql-connector-java-8.0.15.jar Binary files differnew file mode 100644 index 0000000..fa0979f --- /dev/null +++ b/libs/mysql-connector-java-8.0.15.jar diff --git a/src/main/java/pokemon/Database.java b/src/main/java/pokemon/Database.java new file mode 100644 index 0000000..3491ab4 --- /dev/null +++ b/src/main/java/pokemon/Database.java @@ -0,0 +1,30 @@ +package pokemon; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class Database { +	private Connection conn; +	static Database instance=null; +	 +	private Database() { +		String connString="jdbc:mysql://localhost:3306/pokemon?user=root&password="; +		try { +			Class.forName("com.mysql.cj.jdbc.Driver"); +			conn=DriverManager.getConnection(connString); +		} catch (Exception e) { +			// TODO Auto-generated catch block +			e.printStackTrace(); +		} +	} +	 +	public static Database getInstance() { +		if(instance==null) +			instance=new Database(); +		return instance; +	} +	public String getUsername() { +		return "test123"; +	} + +} diff --git a/src/main/webapp/META-INF/MANIFEST.MF b/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path:  + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..08c58a0 --- /dev/null +++ b/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> +  <display-name>ImiPokemon</display-name> +  <welcome-file-list> +    <welcome-file>index.html</welcome-file> +    <welcome-file>index.jsp</welcome-file> +    <welcome-file>index.htm</welcome-file> +    <welcome-file>default.html</welcome-file> +    <welcome-file>default.jsp</welcome-file> +    <welcome-file>default.htm</welcome-file> +  </welcome-file-list> +</web-app>
\ No newline at end of file diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp new file mode 100644 index 0000000..9e758a4 --- /dev/null +++ b/src/main/webapp/index.jsp @@ -0,0 +1,21 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" +    pageEncoding="ISO-8859-1"%> +    <%@page import="pokemon.Database"%> +<!DOCTYPE html> +<% %> +<html> +<head> +<meta charset="ISO-8859-1"> +<title>Insert title here</title> +</head> +<body> +<% + +Database d=Database.getInstance(); + +out.print(d.getUsername()); + +%> + +</body> +</html>
\ No newline at end of file  | 
