Results 1 to 3 of 3

Thread: SQL server

  1. #1
    elish11 is offline Member
    Join Date
    Aug 2007
    Posts
    1
    Rep Power
    0

    Default SQL server

    Hi I am beginner in java;
    I want connect to sql server 2005;
    but i have error
    "The connection to the named instance has failed."
    please help me

  2. #2
    felixtfelix is offline Member
    Join Date
    Dec 2007
    Location
    Mumbai, India
    Posts
    37
    Rep Power
    0

    Default

    Connection connection = null;
    Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
    connection = DriverManger.getconnection("jdbc:sqlserver://servername:1488;selectMethod=cursor","username","p assword");

  3. #3
    herfnai is offline Member
    Join Date
    Aug 2008
    Posts
    13
    Rep Power
    0

    Default

    hello you must make odbc and:
    Connection cn=null;
    Statement stm=null;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    cn=DriverManager.getConnection("jdbcdbc:database name");
    stm=cn.createStatement(ResultSet.TYPE_SCROLL_SENSI TIVE,
    ResultSet.CONCUR_UPDATABLE);
    JOptionPane.showMessageDialog(null,"connected");

    }catch(Exception e)
    {JOptionPane.showMessageDialog(null,"eroor" +"\n"+e.getMessage());


    }

Similar Threads

  1. Replies: 2
    Last Post: 07-15-2008, 06:11 PM
  2. Connecting to a Web server
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 07:57 PM
  3. One server to another server redirection
    By chaudhuri_abhi in forum Java Servlet
    Replies: 1
    Last Post: 02-11-2008, 07:05 PM
  4. MySpeed Server 7.3b
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 09-26-2007, 12:24 PM
  5. WAS Server
    By Albert in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 06-25-2007, 05:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •