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
Printable View
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
Connection connection = null;
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
connection = DriverManger.getconnection("jdbc:sqlserver://servername:1488;selectMethod=cursor","username","p assword");
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());
}