views:

29

answers:

1

guys i'm with a Hell Problem!! :|

i want to make a access to my sql database than is placed in ASUS\MSSQLSERVER1 and database names "Test" with access to user teste with password teste

in java code i coded this:

@Test
    public void TesteTemp() throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException
    {
        Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
        String connString = "jdbc:jtds:sqlserver://ASUS/Test;instance=MSSQLSERVER1;user=teste;password=teste;";

        Connection conn = null;
        try{
            conn = DriverManager.getConnection(connString);
        }catch(SQLException ex){
            ex.printStackTrace();
        }
        conn.close();

    }

And i recieve the next error:

Server ASUS has no instance named MSSQLSERVER1.

It makes sense? I got the MSSQLSERVER1 service running please helpp...

A: 

i resolved the problem.. the code is ok, the problem was than protocols for tcp/ip and named pipes were disabled, i just activated them, now runs ok.. Sql Configuration Manager > Sql Server Network Configuration > Protocols for

ROCK HEART