connect sqlserver in netbeans5.5

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emadattalla1983
    New Member
    • Apr 2007
    • 24

    connect sqlserver in netbeans5.5

    Hi
    I need to know exactly and in details, how can I connect to SQL server 2005 from NetBeans5.5 using sqljdbc_01 package.
    thanks in advance
  • emadattalla1983
    New Member
    • Apr 2007
    • 24

    #2
    Well, forget about the above requirement...
    In the coming line of code:

    Connection c = java.sql.Driver Manager.getConn ection("jdbc:sq lserver://cdwxp-hict8156;Databa seName=Multilin gualTrial01","U sername","Paswo rd");

    I receive this error:
    the Tcp/IP connection to the host has failed.


    When write it like:

    Connection c = java.sql.Driver Manager.getConn ection("jdbc:microsoft:sqlserver://cdwxp-hict8156;Databa seName=Multilin gualTrial01");

    No suitable jdbc driver for "microsoft:sqls erver....."


    Notes: Sql Server is WindowsNT authentication, what should username and passowrd be?

    Please hurry to help
    thanks alot in advance

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      Originally posted by emadattalla1983
      Well, forget about the above requirement...
      In the coming line of code:

      Connection c = java.sql.Driver Manager.getConn ection("jdbc:sq lserver://cdwxp-hict8156;Databa seName=Multilin gualTrial01","U sername","Paswo rd");

      I receive this error:
      the Tcp/IP connection to the host has failed.


      When write it like:

      Connection c = java.sql.Driver Manager.getConn ection("jdbc:microsoft:sqlserver://cdwxp-hict8156;Databa seName=Multilin gualTrial01");

      No suitable jdbc driver for "microsoft:sqls erver....."


      Notes: Sql Server is WindowsNT authentication, what should username and passowrd be?

      Please hurry to help
      thanks alot in advance
      Did you use class.forname and DriverManager.g etConnection(), and all those to set up the connection? Is the jdbc driver in your classpath or attached to the file?

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        And username and password should be from a valid account on your SQL server. (It's a very big security risk to use the root or admin user, as I'm sure you know)

        Comment

        Working...