Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- com.microsoft.sqlserver.jdbc.SQLServerException: The server principal "shopmart" is not able to access the database "shopmart_db" under the current security context.
- private static final String JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- private static final String DB_URL = "jdbc:sqlserver://10.12.92.185:1433; databaseName=shopmart_db";
- private static final String USERNAME = "tonton_ivr";
- private static final String PASSWORD = "tontonivr";
- public Connection getJDBCConnection() {
- Connection conn = null;
- try {
- Class.forName(JDBC_DRIVER);
- conn = DriverManager.getConnection(DB_URL, USERNAME, PASSWORD);
- } catch (Exception ex) {
- System.out.println("DB Connection failed: " + ex);
- }
- return conn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement