Commit 12cea38a by Juan Carlos Yupanqui

[STABLE] Version estable horarios

parent a85e2678
...@@ -999,16 +999,16 @@ exists or setup the property manually. For example like this: ...@@ -999,16 +999,16 @@ exists or setup the property manually. For example like this:
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
<copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.activation.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.java-dotenv-3.1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.json-20171018.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/> <copyfiles files="${file.reference.json-20171018.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.dotenv-0.1.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/> <mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
</target> </target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
<copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.activation.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.mysql-connector-java-3.1.14-bin.jar-1}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.java-dotenv-3.1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.json-20171018.jar}" todir="${build.web.dir}/WEB-INF/lib"/> <copyfiles files="${file.reference.json-20171018.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.dotenv-0.1.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
</target> </target>
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib"> <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
<delete dir="${build.web.dir}/WEB-INF/lib"/> <delete dir="${build.web.dir}/WEB-INF/lib"/>
......
build.xml.data.CRC32=70a6affc build.xml.data.CRC32=22d59e15
build.xml.script.CRC32=5a966c0c build.xml.script.CRC32=5a966c0c
build.xml.stylesheet.CRC32=651128d4@1.77.1.1 build.xml.stylesheet.CRC32=651128d4@1.77.1.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=70a6affc nbproject/build-impl.xml.data.CRC32=22d59e15
nbproject/build-impl.xml.script.CRC32=9c299a49 nbproject/build-impl.xml.script.CRC32=a9c734cb
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
...@@ -29,7 +29,7 @@ endorsed.classpath=\ ...@@ -29,7 +29,7 @@ endorsed.classpath=\
${libs.javaee-endorsed-api-6.0.classpath} ${libs.javaee-endorsed-api-6.0.classpath}
excludes= excludes=
file.reference.activation.jar=D:\\LIBRERIAS\\activation.jar file.reference.activation.jar=D:\\LIBRERIAS\\activation.jar
file.reference.java-dotenv-3.1.1.jar=C:\\Users\\sistem17user\\Desktop\\Juan Carlos Yupanqui Lozano\\Libreria\\LIBRERIAS 2\\DotEnv\\java-dotenv-3.1.1.jar file.reference.dotenv-0.1.1.jar=C:\\Users\\sistem17user\\Desktop\\Juan Carlos Yupanqui Lozano\\Libreria\\LIBRERIAS 2\\DotEnv\\dotenv-0.1.1.jar
file.reference.json-20171018.jar=D:\\LIBRERIAS\\json-20171018.jar file.reference.json-20171018.jar=D:\\LIBRERIAS\\json-20171018.jar
file.reference.mysql-connector-java-3.1.14-bin.jar-1=D:\\LIBRERIAS\\mysql-connector-java-3.1.14-bin.jar file.reference.mysql-connector-java-3.1.14-bin.jar-1=D:\\LIBRERIAS\\mysql-connector-java-3.1.14-bin.jar
includes=** includes=**
...@@ -48,8 +48,8 @@ jar.compress=false ...@@ -48,8 +48,8 @@ jar.compress=false
javac.classpath=\ javac.classpath=\
${file.reference.activation.jar}:\ ${file.reference.activation.jar}:\
${file.reference.mysql-connector-java-3.1.14-bin.jar-1}:\ ${file.reference.mysql-connector-java-3.1.14-bin.jar-1}:\
${file.reference.java-dotenv-3.1.1.jar}:\ ${file.reference.json-20171018.jar}:\
${file.reference.json-20171018.jar} ${file.reference.dotenv-0.1.1.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.debug=true javac.debug=true
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
<library dirs="200"> <library dirs="200">
<file>${file.reference.java-dotenv-3.1.1.jar}</file> <file>${file.reference.json-20171018.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
<library dirs="200"> <library dirs="200">
<file>${file.reference.json-20171018.jar}</file> <file>${file.reference.dotenv-0.1.1.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war> <path-in-war>WEB-INF/lib</path-in-war>
</library> </library>
</web-module-libraries> </web-module-libraries>
......
package pe.siso.horario.MySqlDAO; package pe.siso.horario.MySqlDAO;
//import io.github.cdimascio.dotenv.Dotenv;
import io.github.arniu.dotenv.Dotenv;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import pe.siso.horario.DAO.AreaDAO; import pe.siso.horario.DAO.AreaDAO;
...@@ -48,17 +50,31 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -48,17 +50,31 @@ public class MySqlDAOFactory extends DAOFactory {
} }
} }
// Dotenv dotenv = Dotenv // public static void main(String[] args) throws SQLException {
// .configure() // System.out.println(MySqlDAOFactory.obtenerConexion("horario"));
// .directory(OsUtils.getDotEnvPath("trismegisto-asistencia"))
// .load();
// public static void main(String[] args) {
// MySqlDAOFactory.obtenerConexion("horario");
//
// } // }
public static Connection obtenerConexion(String base) { public static Connection obtenerConexion(String base) {
Connection conexion = null; Connection conexion = null;
String path = OsUtils.getDotEnvPath("horario") + "/.env";
Dotenv dotenv = null;
try {
dotenv = Dotenv
.configure()
.path(path)
.encoding("utf-8")
.debug(false)
.load();
} catch (Exception e) {
System.out.println("ERROR AL OBTENER EL ARCHIVO DOTENV --->> " + e.getMessage());
}
System.out.println("PAATH =>> " + path);
String host = dotenv.get("MYSQL_HOST_SERVIDOR_HORARIO");
String port = dotenv.get("MYSQL_PORT_SERVIDOR_HORARIO");
String user = dotenv.get("MYSQL_USER_SERVIDOR_HORARIO");
String password = dotenv.get("MYSQL_PASSWORD_SERVIDOR_HORARIO");
if (base.equals("encuentas") || base.equals("nuevo") || base.equals("horario") || base.equals("sacoolive3")) { if (base.equals("encuentas") || base.equals("nuevo") || base.equals("horario") || base.equals("sacoolive3")) {
if (base.equals("horario")) { if (base.equals("horario")) {
base = "horarios_docente"; base = "horarios_docente";
...@@ -67,17 +83,19 @@ public class MySqlDAOFactory extends DAOFactory { ...@@ -67,17 +83,19 @@ public class MySqlDAOFactory extends DAOFactory {
} }
try { try {
conexion = DriverManager.getConnection( conexion = DriverManager.getConnection(
//Pruebas "jdbc:mysql://" + host + ":" + port + "/" + base,
"jdbc:mysql://serverprueba:3306/" + base, user,
"desarrollo", password);
"5VC02019");
//Pruebas
// "jdbc:mysql://serverprueba:3306/" + base,
// "desarrollo",
// "5VC02019");
// Producción // Producción
// "jdbc:mysql://172.16.2.68:3306/" + base, // "jdbc:mysql://172.16.2.68:3306/" + base,
// "sis_horarios", // "sis_horarios",
// "Sy356ho899"); // "Sy356ho899");
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }
......
...@@ -92,6 +92,7 @@ public final class OsUtils { ...@@ -92,6 +92,7 @@ public final class OsUtils {
for (char letter : alphabet) { for (char letter : alphabet) {
path = letter + ":/dotenv/" + projectName; path = letter + ":/dotenv/" + projectName;
File directory = new File(path); File directory = new File(path);
// System.out.println("LETTER --->> " + letter);
if (directory.exists()) { if (directory.exists()) {
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment