Article View: es.comp.lenguajes.java
Article #26822Re: JDBC, ODBC y otras lindezas
From: Jonathan Revusky
Date: Mon, 23 Nov 1998 00:00
Date: Mon, 23 Nov 1998 00:00
43 lines
1822 bytes
1822 bytes
"Jos� Mar�a" wrote:
>
> Alg�n afortunado lector podria indicarme si hay algunos drivers JDBC que
> sean "gratix", bien sean jdbc-odbc o directamente jdbc-Ms Access.
Hola de nuevo, Jos� Mar�a.
Me siento como el mago de Oz al decirte que siempre has tenido lo que
estabas buscando. El JDK de Sun lleva incorporado una clase que funciona
como puente jdbc-odbc. Me parece que el SDK de MS tambi�n, en otro
package.
Prueba el c�digo siguiente:
static final String SUNDRIVER="sun.jdbc.odbc.JdbcOdbcDriver";
static final String MSDRIVER="com.ms.jdbc.odbc.JdbcOdbcDriver";
public static boolean cargaDriver() {
Class c = null;
try {
Class.forName(SUNDRIVER);
}
catch (ClassNotFoundException e) {
try {
Class.forName(MSDRIVER);
}
catch (ClassNotFoundException e) {
System.out.println("No se encuentra ningun driver.");
return false;
}
}
return true;
}
Invocas esta funci�n y deber�as poder hacer lo que quieras -- suponiendo
que tienes la parte ODBC controlada, por supuesto.
Jonathan Revusky
--
Available for Java and Delphi Consulting
Make your .class files double-clickable
with SmartJ
http://www.bigfoot.com/~crystalline.solutions
Technical Details
Message-ID:
<3659E4F1.3F845A83@jet.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<73cljv$ird$1@talia.mad.ibernet.es>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: 1116f3,f21cedec564a5b62 X-Google-Attributes: gid1116f3,public From: Jonathan Revusky <jrevusky@jet.es> Subject: Re: JDBC, ODBC y otras lindezas Date: 1998/11/23 Message-ID: <3659E4F1.3F845A83@jet.es> X-Deja-AN: 414957920 Content-Transfer-Encoding: 8bit References: <73cljv$ird$1@talia.mad.ibernet.es> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Telefonica Transmision de Datos Mime-Version: 1.0 Reply-To: jrevusky@bigfoot.com Newsgroups: es.comp.lenguajes.java