Java - AYUDA CON DESARROLLO WEB PARA CONECTAR CON SQL SERVER

 
Vista:

AYUDA CON DESARROLLO WEB PARA CONECTAR CON SQL SERVER

Publicado por kevin zapata (5 intervenciones) el 24/11/2016 22:55:32
Buenas estoy haciendo un mantenimiento con javascript y no que enlase poner en el driver que esta mas abajo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package Conexion;
 
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
 
public class ConectaDB {
 
    public Connection getConnection() throws SQLException{
        Connection cn = null;
        try {
            Class.forName(driver).newInstance();
            cn = DriverManager.getConnection(url, user, password);
 
        } catch (ClassNotFoundException e) {
              throw new SQLException(e.getMessage());
        } catch (InstantiationException e) {
            throw new SQLException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new SQLException(e.getMessage());
        } catch (SQLException e) {
            throw new SQLException(e.getMessage());
        }
        return cn;
 
    }
private final String url = "jdbc:sqlserver://sistemas:1433/DBDIONYS";
private final String driver = "?????";                             /*aqui no se que poner ayuda*/
private final String user = "DESARROLLOTI";
private final String password = "123456789";
}



solo se cuando es mysql pero en sqlserver no tanto ayuda porfavor
yo descargue el jdbc4
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder