Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. com.microsoft.sqlserver.jdbc.SQLServerException: The server principal "shopmart" is not able to access the database "shopmart_db" under the current security context.
  2.  
  3. private static final String JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  4. private static final String DB_URL = "jdbc:sqlserver://10.12.92.185:1433; databaseName=shopmart_db";
  5. private static final String USERNAME = "tonton_ivr";
  6. private static final String PASSWORD = "tontonivr";
  7.  
  8. public Connection getJDBCConnection() {
  9. Connection conn = null;
  10. try {
  11. Class.forName(JDBC_DRIVER);
  12. conn = DriverManager.getConnection(DB_URL, USERNAME, PASSWORD);
  13.  
  14. } catch (Exception ex) {
  15. System.out.println("DB Connection failed: " + ex);
  16. }
  17. return conn;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement