Advertisement
Guest User

Untitled

a guest
Feb 5th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.92 KB | None | 0 0
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. import javax.servlet.http.HttpServletRequest;
  6. import javax.servlet.http.HttpSession;
  7.  
  8. import org.springframework.stereotype.Service;
  9.  
  10. @Service
  11. public class service_impl_user implements service_user
  12. {
  13. @Override
  14. public boolean check_login(HttpServletRequest req, final String user_id, final String user_pw, final String user_ip)
  15. {
  16. try {
  17. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  18. } catch (ClassNotFoundException e) {
  19. // TODO Auto-generated catch block
  20. System.out.println("Failed to Driver.");
  21. e.printStackTrace();
  22. }
  23.  
  24. String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
  25. "databaseName=integrity;user=sa;password=ms3cur3$|;";
  26. try {
  27. Connection con = DriverManager.getConnection(connectionUrl);
  28. } catch (SQLException e) {
  29. // TODO Auto-generated catch block
  30. System.out.println("Failed to connection.");
  31. e.printStackTrace();
  32. }
  33.  
  34.  
  35. return false;
  36. }
  37.  
  38. public void logout(HttpSession session)
  39. {
  40. session.invalidate();
  41. }
  42. }
  43.  
  44. <?xml version="1.0" encoding="UTF-8"?>
  45. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  46. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  47. <modelVersion>4.0.0</modelVersion>
  48. <groupId>co.msecure</groupId>
  49. <artifactId>integrity</artifactId>
  50. <name>safeapp_integrity</name>
  51. <packaging>war</packaging>
  52. <version>1.0.0-BUILD-SNAPSHOT</version>
  53. <properties>
  54. <java-version>1.6</java-version>
  55. <org.springframework-version>4.1.6.RELEASE</org.springframework-version>
  56. <org.aspectj-version>1.6.10</org.aspectj-version>
  57. <org.slf4j-version>1.6.6</org.slf4j-version>
  58. </properties>
  59. <dependencies>
  60. <!-- Spring -->
  61. <dependency>
  62. <groupId>org.springframework</groupId>
  63. <artifactId>spring-context</artifactId>
  64. <version>${org.springframework-version}</version>
  65. <exclusions>
  66. <!-- Exclude Commons Logging in favor of SLF4j -->
  67. <exclusion>
  68. <groupId>commons-logging</groupId>
  69. <artifactId>commons-logging</artifactId>
  70. </exclusion>
  71. </exclusions>
  72. </dependency>
  73. <dependency>
  74. <groupId>org.springframework</groupId>
  75. <artifactId>spring-webmvc</artifactId>
  76. <version>${org.springframework-version}</version>
  77. </dependency>
  78.  
  79. <!-- AspectJ -->
  80. <dependency>
  81. <groupId>org.aspectj</groupId>
  82. <artifactId>aspectjrt</artifactId>
  83. <version>${org.aspectj-version}</version>
  84. </dependency>
  85.  
  86. <!-- Logging -->
  87. <dependency>
  88. <groupId>org.slf4j</groupId>
  89. <artifactId>slf4j-api</artifactId>
  90. <version>${org.slf4j-version}</version>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.slf4j</groupId>
  94. <artifactId>jcl-over-slf4j</artifactId>
  95. <version>${org.slf4j-version}</version>
  96. <scope>runtime</scope>
  97. </dependency>
  98. <dependency>
  99. <groupId>org.slf4j</groupId>
  100. <artifactId>slf4j-log4j12</artifactId>
  101. <version>${org.slf4j-version}</version>
  102. <scope>runtime</scope>
  103. </dependency>
  104. <dependency>
  105. <groupId>log4j</groupId>
  106. <artifactId>log4j</artifactId>
  107. <version>1.2.15</version>
  108. <exclusions>
  109. <exclusion>
  110. <groupId>javax.mail</groupId>
  111. <artifactId>mail</artifactId>
  112. </exclusion>
  113. <exclusion>
  114. <groupId>javax.jms</groupId>
  115. <artifactId>jms</artifactId>
  116. </exclusion>
  117. <exclusion>
  118. <groupId>com.sun.jdmk</groupId>
  119. <artifactId>jmxtools</artifactId>
  120. </exclusion>
  121. <exclusion>
  122. <groupId>com.sun.jmx</groupId>
  123. <artifactId>jmxri</artifactId>
  124. </exclusion>
  125. </exclusions>
  126. <scope>runtime</scope>
  127. </dependency>
  128.  
  129. <!-- @Inject -->
  130. <dependency>
  131. <groupId>javax.inject</groupId>
  132. <artifactId>javax.inject</artifactId>
  133. <version>1</version>
  134. </dependency>
  135.  
  136. <!-- Servlet -->
  137. <dependency>
  138. <groupId>javax.servlet</groupId>
  139. <artifactId>servlet-api</artifactId>
  140. <version>2.5</version>
  141. <scope>provided</scope>
  142. </dependency>
  143. <dependency>
  144. <groupId>javax.servlet.jsp</groupId>
  145. <artifactId>jsp-api</artifactId>
  146. <version>2.1</version>
  147. <scope>provided</scope>
  148. </dependency>
  149. <dependency>
  150. <groupId>javax.servlet</groupId>
  151. <artifactId>jstl</artifactId>
  152. <version>1.2</version>
  153. </dependency>
  154.  
  155. <!-- Test -->
  156. <dependency>
  157. <groupId>junit</groupId>
  158. <artifactId>junit</artifactId>
  159. <version>4.7</version>
  160. <scope>test</scope>
  161. </dependency>
  162.  
  163. <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
  164. <!-- <dependency> -->
  165. <!-- <groupId>org.springframework</groupId> -->
  166. <!-- <artifactId>spring-jdbc</artifactId> -->
  167. <!-- <version>3.2.0.RELEASE</version> -->
  168. <!-- </dependency> -->
  169.  
  170. <dependency>
  171. <groupId>com.microsoft.sqlserver</groupId>
  172. <artifactId>sqljdbc42</artifactId>
  173. <version>4.2</version>
  174. </dependency>
  175.  
  176. <!-- <dependency> -->
  177. <!-- <groupId>org.mybatis</groupId> -->
  178. <!-- <artifactId>mybatis-spring</artifactId> -->
  179. <!-- <version>1.2.1</version> -->
  180. <!-- </dependency> -->
  181.  
  182. <!-- <dependency> -->
  183. <!-- <groupId>org.mybatis</groupId> -->
  184. <!-- <artifactId>mybatis</artifactId> -->
  185. <!-- <version>3.2.3</version> -->
  186. <!-- </dependency> -->
  187.  
  188. </dependencies>
  189. <build>
  190. <plugins>
  191. <plugin>
  192. <artifactId>maven-eclipse-plugin</artifactId>
  193. <version>2.9</version>
  194. <configuration>
  195. <additionalProjectnatures>
  196. <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
  197. </additionalProjectnatures>
  198. <additionalBuildcommands>
  199. <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
  200. </additionalBuildcommands>
  201. <downloadSources>true</downloadSources>
  202. <downloadJavadocs>true</downloadJavadocs>
  203. </configuration>
  204. </plugin>
  205. <plugin>
  206. <groupId>org.apache.maven.plugins</groupId>
  207. <artifactId>maven-compiler-plugin</artifactId>
  208. <version>2.5.1</version>
  209. <configuration>
  210. <source>1.6</source>
  211. <target>1.6</target>
  212. <compilerArgument>-Xlint:all</compilerArgument>
  213. <showWarnings>true</showWarnings>
  214. <showDeprecation>true</showDeprecation>
  215. </configuration>
  216. </plugin>
  217. <plugin>
  218. <groupId>org.codehaus.mojo</groupId>
  219. <artifactId>exec-maven-plugin</artifactId>
  220. <version>1.2.1</version>
  221. <configuration>
  222. <mainClass>org.test.int1.Main</mainClass>
  223. </configuration>
  224. </plugin>
  225. </plugins>
  226. </build>
  227. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement