Simple select not working on JDBC MSSQL ?
- by Xinus
I am trying to move project which was using MySQL database to the one that uses MSSQL 2008, But the select that was working in mysql is no longer working in MSSQL
PreparedStatement statement = connection
.prepareStatement("select u.user_firstname,u.user_lastname from user_details u, login l where l.username=? and l.login_user = u.user_id");
statement.setString(1, userName);
ResultSet resultSet = (ResultSet) statement.executeQuery();
It always gives me empty resultset even when there are values corresponding to that username,
When I run query using MSSQL management studio - query works properly i.e. it gives non-zero rows, Are there any MSSQL specific change I need to do ?