Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 38 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
<?xml version="1.0" ?>
<project name="AntExample1" default="war">


<target name="compile">
<mkdir dir="web/WEB-INF/classes"/>
<javac srcdir="src"
destdir="web/WEB-INF/classes"
includeantruntime="false"
release="8">
<classpath>
<fileset dir="libs">
<include name="**/*.jar"/>
</fileset>
<fileset dir="web/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>

<target name="init">
<mkdir dir="distribution" />
</target>

<target name="war" depends="init">
<target name="war" depends="init, compile">
<war destfile="distribution/comp.war" webxml="web/WEB-INF/web.xml">
<fileset dir="web">
<exclude name="**/work/**"/>
Expand All @@ -16,6 +33,24 @@

<target name="clean">
<delete dir="distribution" />
<delete dir="web/WEB-INF/classes" />
</target>


<target name="run" depends="compile">
<java classname="com.sas.comp.server.EmbeddedServer"
fork="true">
<classpath>
<pathelement location="web/WEB-INF/classes"/>
<fileset dir="libs">
<include name="**/*.jar"/>
</fileset>
<fileset dir="web/WEB-INF/lib">
<include name="**/*.jar/"/>
</fileset>
</classpath>
<arg value="--port=8000"/>
<sysproperty key="dbUrl" value="jdbc:mysql://soccer.na.sas.com:3306/soccer?useSSL=false"/>
</java>
</target>

</project>
4 changes: 3 additions & 1 deletion src/com/sas/comp/mysql/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ public class Database {

private static Connection getConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection("jdbc:mysql://localhost:3306/soccer?useSSL=false", "soccer", "i<3soccer");
String dbUrl = System.getProperty("dbUrl", "jdbc:mysql://localhost:3306/soccer?useSSL=false");
// System.out.println("dbUrl: " + dbUrl);
return DriverManager.getConnection(dbUrl, "soccer", "i<3soccer");
//return DriverManager.getConnection("jdbc:mysql://soccerdb.na.sas.com:3306/soccer?useSSL=false", "soccer", "i<3soccer");
}

Expand Down