Advertisement
Guest User

Untitled

a guest
Jul 20th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /**
  2. * The following utility helps switching the DEV DB from Phase 1 to Phase 2 DDL's & viceversa.
  3. * Program Arguments can be : 1 [or] 2
  4. * 1-> Drop all and create Phase 1 tables
  5. * 2-> Drop all and create Phase 2 tables
  6. */
  7. package org.shashank;
  8.  
  9. import java.sql.Connection;
  10. import java.sql.DriverManager;
  11. import java.sql.ResultSet;
  12. import java.sql.Statement;
  13.  
  14. /**
  15. * @author al8r
  16. *
  17. */
  18. public class Main {
  19.  
  20. /**
  21. * @param args
  22. */
  23. public static void main(String[] args) {
  24.  
  25. String datasource = "jdbc:teradata://y0319t1811/TMODE=ANSI,CHARSET=UTF8";
  26. String username = "dbc";
  27. String password = "dbc";
  28. String driver = "com.teradata.jdbc.TeraDriver";
  29.  
  30. Connection con = null;
  31. Statement stmt = null;
  32.  
  33. try{
  34.  
  35. Class.forName(driver);
  36. con = DriverManager.getConnection(datasource,username,password);
  37. stmt = con.createStatement();
  38. String specialstring="3/4\" SLV T-SHIRT DRS";
  39. String sql = "SELECT EPM_STYLE_DESC FROM DEV_AW_LDG.PROD_EPM_RMS_STYLE_LDG where EPM_STYLE_DESC='3/4\" SLV T-SHIRT DRS'";
  40. System.out.println(sql);
  41. ResultSet rs = stmt.executeQuery(sql);
  42. while(rs.next())
  43. {
  44. System.out.println(rs.getString(1));
  45. }
  46. }
  47. catch(Exception e)
  48. {
  49. System.out.println("ooops!"+e);
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement