This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hello NB: I couldn't connect to SQL server 2008 Express with JDBC from IDE, not from code, I use sqljdbc4.jar, the DB is local. Thanks Edgardo
Please, could you attach more information about your problem? NetBeans IDE build number, messages.log (found in View|IDE Log) after trying connect to the server. Thanks
Created attachment 86219 [details] DB Image
Created attachment 86220 [details] DB Image 2
Created attachment 86221 [details] DB Image 3
Created attachment 86222 [details] NB Image
Created attachment 86223 [details] NB Image 2
Created attachment 86224 [details] NB Image 3
Created attachment 86225 [details] NB Image 4
Created attachment 86226 [details] NB Image 5
Created attachment 86227 [details] NB Image 6
The Java Code is: package conexion; /** * * @author Administrador */ import java.sql.*; public class conexion { public static void main(String[] args) { // Create a variable for the connection string. String sUrl = "jdbc:sqlserver://localhost\\SQLEXPRESS;databaseName=prueba;integratedSecurity=true;"; // Declare the JDBC objects. Connection con = null; Statement stmt = null; ResultSet rs = null; try { System.out.println("--< Antes del Error >--"); // Establish the connection. Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); con = DriverManager.getConnection(sUrl); // Create and execute an SQL statement that returns some data. String SQL = "SELECT TOP 10 * FROM usuarios"; stmt = con.createStatement(); rs = stmt.executeQuery(SQL); // Iterate through the data in the result set and display it. while (rs.next()) { System.out.println(rs.getString(1) + " " + rs.getString(2)); } } // Handle any errors that may have occurred. catch (Exception e) { System.out.println("Ocurrio un Error"); e.printStackTrace(); } finally { if (rs != null) try { rs.close(); } catch(Exception e) {} if (stmt != null) try { stmt.close(); } catch(Exception e) {} if (con != null) try { con.close(); } catch(Exception e) {} } } }
Edgardo, thanks for information. But I still don't see where could be a problem. I tried to reproduce the issue with MSSQL 2005 on localhost with sqljdbc4 driver (with JDK1.6!) and I can connect database. Check you HTTP network proxy in Tools|Options and make sure localhost is among No Proxy Hosts (a button More in Manual Proxy Settings). Maybe it can help. Regards
Created attachment 86334 [details] CN Image 1
Created attachment 86335 [details] CN Image 2
I have checked the HTTP proxy, but I have the same problem. Thanks
Created attachment 86536 [details] CN Image 3
I could connect via jdbc-odbc bridge , but I continue without connect via jdbc. One detail, Sql Server 2005 is similar to Sql Server 2008, but isn't the same. Could you send me a right configuration?