I want to simply get data from sql server and use it inside my java program for this reason i have used:sql server 2017, jdk10, mssql-jdbc-6.2.2.jre8.jar. by the way i dindn' remember my sql database password(i mean i have forgotten sql server autentification password) that's why i have used integratedSecurity=true and add sqljdbc_auth.dll in system32( i guess it works fine for me) but for some reason adter staring sql server servicies and adding new rules in firewall for servure connection i can't get data from server, i gto error like this:
java lang classnotfoundexception javax xml bind datatypeconverter
here is my code , do you have any idea how should i solve this task?
public void dbConnect(String db_connect_string)
{
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection(db_connect_string);
System.out.println("connected");
Statement statement = conn.createStatement();
String queryString = "select * from tab1";
ResultSet rs = statement.executeQuery(queryString);
while (rs.next()) {
System.out.println(rs.getString(1));
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
DBConnection connServer = new DBConnection();
connServer.dbConnect("jdbc:sqlserver://localhost:51696;databaseName=test;integratedSecurity=true");
}