[teiid-commits] teiid SVN: r2830 - branches/7.1.x/runtime/src/main/java/org/teiid/odbc.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Jan 11 15:39:39 EST 2011


Author: rareddy
Date: 2011-01-11 15:39:39 -0500 (Tue, 11 Jan 2011)
New Revision: 2830

Modified:
   branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
Log:
TEIID-1428: directly using the TeiidDriver instead of the DriverManager  to avoid the registration.

Modified: branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2011-01-11 02:40:20 UTC (rev 2829)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2011-01-11 20:39:39 UTC (rev 2830)
@@ -23,7 +23,6 @@
 
 import java.io.IOException;
 import java.io.StringReader;
-import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -36,6 +35,7 @@
 import java.util.regex.Pattern;
 
 import org.teiid.jdbc.ConnectionImpl;
+import org.teiid.jdbc.TeiidDriver;
 import org.teiid.logging.LogConstants;
 import org.teiid.logging.LogManager;
 import org.teiid.runtime.RuntimePlugin;
@@ -169,7 +169,12 @@
 	@Override
 	public void logon(String databaseName, String user, String password) {
 		try {
-			this.connection =  (ConnectionImpl)DriverManager.getConnection("jdbc:teiid:"+databaseName+";ApplicationName=ODBC", user, password); //$NON-NLS-1$ //$NON-NLS-2$
+			 java.util.Properties info = new java.util.Properties();
+			String url = "jdbc:teiid:"+databaseName+";ApplicationName=ODBC"; //$NON-NLS-1$ //$NON-NLS-2$
+			TeiidDriver driver = new TeiidDriver();
+			info.put("user", user); //$NON-NLS-1$
+			info.put("password", password); //$NON-NLS-1$
+			this.connection =  (ConnectionImpl)driver.connect(url, info);
 			int hash = this.connection.getConnectionId().hashCode();
 			this.client.authenticationSucess(hash, hash);
 			sync();



More information about the teiid-commits mailing list