这给出了语法错误xD,我也知道它在url中,但实际上并不太明白:
public String usuario="sa";
public String contraseña="hola";
public String url ="jdbc:sqlserver://localhost;databaseName=ALIBABASE;";
public Connection cn=null;
public Statement st=null;
public Statement Conectar()
{
try
{
Connection cn = DriverManager.getConnection( url,usuario,contraseña);
st=cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
} catch (SQLException i)
{
JOptionPane.showMessageDialog(null, i);
}
return st;
}
}