Código (java) [Seleccionar]
import java.sql.*;
public class NewClass {
public static void main(String args[]){
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
}catch(Exception e){e.printStackTrace();}
try{
Connection conexion =DriverManager.getConnection("jdbc:sqlserver://localhost:1433;database = mio;"+
"integratedSecurity=true");
Statement consulta = conexion.createStatement();//PARA HACER CONSULTAS
}catch(Exception e){e.printStackTrace();}
}
}