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.

Bug 170016 - Error connect to SQL Server 2008
Summary: Error connect to SQL Server 2008
Status: RESOLVED INCOMPLETE
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-07 03:31 UTC by ekornschuh
Modified: 2009-08-22 21:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
DB Image (104.10 KB, text/plain)
2009-08-14 02:31 UTC, ekornschuh
Details
DB Image 2 (130.68 KB, text/plain)
2009-08-14 02:32 UTC, ekornschuh
Details
DB Image 3 (130.46 KB, text/plain)
2009-08-14 02:32 UTC, ekornschuh
Details
NB Image (117.06 KB, text/plain)
2009-08-14 02:34 UTC, ekornschuh
Details
NB Image 2 (125.57 KB, text/plain)
2009-08-14 02:35 UTC, ekornschuh
Details
NB Image 3 (115.99 KB, text/plain)
2009-08-14 02:36 UTC, ekornschuh
Details
NB Image 4 (125.45 KB, image/jpeg)
2009-08-14 02:37 UTC, ekornschuh
Details
NB Image 5 (111.78 KB, image/jpeg)
2009-08-14 02:37 UTC, ekornschuh
Details
NB Image 6 (150.01 KB, image/jpeg)
2009-08-14 02:38 UTC, ekornschuh
Details
CN Image 1 (31.52 KB, image/jpeg)
2009-08-17 17:17 UTC, ekornschuh
Details
CN Image 2 (30.79 KB, image/jpeg)
2009-08-17 17:18 UTC, ekornschuh
Details
CN Image 3 (63.65 KB, image/jpeg)
2009-08-22 21:04 UTC, ekornschuh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ekornschuh 2009-08-07 03:31:20 UTC
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
Comment 1 Jiri Rechtacek 2009-08-11 17:11:56 UTC
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
Comment 2 ekornschuh 2009-08-14 02:31:26 UTC
Created attachment 86219 [details]
DB Image
Comment 3 ekornschuh 2009-08-14 02:32:01 UTC
Created attachment 86220 [details]
DB Image 2
Comment 4 ekornschuh 2009-08-14 02:32:45 UTC
Created attachment 86221 [details]
DB Image 3
Comment 5 ekornschuh 2009-08-14 02:34:56 UTC
Created attachment 86222 [details]
NB Image
Comment 6 ekornschuh 2009-08-14 02:35:59 UTC
Created attachment 86223 [details]
NB Image 2
Comment 7 ekornschuh 2009-08-14 02:36:28 UTC
Created attachment 86224 [details]
NB Image 3
Comment 8 ekornschuh 2009-08-14 02:37:11 UTC
Created attachment 86225 [details]
NB Image 4
Comment 9 ekornschuh 2009-08-14 02:37:50 UTC
Created attachment 86226 [details]
NB Image 5
Comment 10 ekornschuh 2009-08-14 02:38:16 UTC
Created attachment 86227 [details]
NB Image 6
Comment 11 ekornschuh 2009-08-14 02:39:42 UTC
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) {}
    }
    }
}
Comment 12 Jiri Rechtacek 2009-08-17 15:26:58 UTC
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
Comment 13 ekornschuh 2009-08-17 17:17:26 UTC
Created attachment 86334 [details]
CN Image 1
Comment 14 ekornschuh 2009-08-17 17:18:01 UTC
Created attachment 86335 [details]
CN Image 2
Comment 15 ekornschuh 2009-08-17 17:20:35 UTC
I have checked the HTTP proxy, but I have the same problem.
Thanks
Comment 16 ekornschuh 2009-08-22 21:04:03 UTC
Created attachment 86536 [details]
CN Image 3
Comment 17 ekornschuh 2009-08-22 21:05:15 UTC
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?