Im am trying to hit the secondary node on a sql server 2012 DB using "ApplicationIntent=readonly"
in the connection string.
It is still hitting the primary node, not sure why.
I'm using sqljdbc4-4.0
jar
java JDBC call:
ResultSet results = null;
PreparedStatement preparedStatement = null;
Connection conn = null;
String SQL_SERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
Class.forName(SQL_SERVER_DRIVER);
String dbString = "jdbc:sqlserver://*****;applicationIntent=ReadOnly;databaseName=****;user=*****;password=****;";
conn = DriverManager.getConnection(dbString);
preparedStatement = conn.prepareStatement("some_sql");
results = preparedStatement.executeQuery();