You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
756 B

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package in.gov.chennaicorporation.gccoffice.pgr.dbconnection;
  2. import java.sql.Connection;
  3. import java.sql.DriverManager;
  4. import java.sql.SQLException;
  5. import org.springframework.stereotype.Component;
  6. @Component
  7. public class DBConnection {
  8. private static Connection dbcon;
  9. private static final String l_sUrl = "jdbc:oracle:thin:@10.1.0.14:1521:chncorp";
  10. private static final String user="FAS";
  11. private static final String password="FAS";
  12. public static Connection getConnection() {
  13. try {
  14. Connection pgr_Con = DriverManager.getConnection(l_sUrl,user,password);
  15. System.out.println("pgr_conn Con :"+ l_sUrl );
  16. dbcon=pgr_Con;
  17. return pgr_Con;
  18. } catch (SQLException e) {
  19. e.printStackTrace();
  20. }
  21. return dbcon;
  22. }
  23. }