Obtener información de un driver dado des de una aplicación
Artículo por Club Developers · 01 noviembre 2006
2903 vistas
Tendremos que usar los métodos dados por la interfaz Driver:
Veamos la salida para MySQL Connector/J:
java
int majorVersion = driver.getMajorVersion(); int minorVersion = driver.getMinorVersion(); v"+majorVersion+"."+minorVersion); for(int i=0 ;i<props.length;i++){ if(prop.choices!=null){ for(int j=0;j<prop.choices.length;j++){ } } }
Veamos la salida para MySQL Connector/J:
java
Prop name = HOST Prop description = Hostname of MySQL Server Prop value = localhost Prop name = PORT Prop description = Port number of MySQL Server Prop value = 3306 Prop name = DBNAME Prop description = Database name Prop value = test Prop name = user Prop description = Username to authenticate as Prop value = null Prop name = password Prop description = Password to use for authentication Prop value = null Prop name = autoReconnect Prop description = Should the driver try to re-establish bad connections? Prop value = false prop choice 0 = true prop choice 1 = false Prop name = maxReconnects Prop description = Maximum number of reconnects to attempt if autoReconnect is true Prop value = 3 Prop name = initialTimeout Prop description = Initial timeout (seconds) to wait between failed connections Prop value = 2 //+ 90 líneas