Programación General > Java
Ayuda Para Conexion
lencho:
prueba con esto.
--- Código: Text --- public void AbrirConexion(){ try{ Class.forName("com.mysql.jdbc.Driver"); try{ BasedeDatos = "jdbc:mysql://localhost/"+"TuBaseDatos"+"?user=root&password="; conex = DriverManager.getConnection(BasedeDatos); SentenciaSQL = conex.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); }catch(SQLException sqle){ } }catch(Exception e){ JOptionPane.showMessageDialog(new JFrame(), "Error en la conexión:" + e.toString(),"hola",0); } }
Espero y te sirva.
BYTE.
Navegación
[*] Página Anterior
Ir a la versión completa