2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 import java.sql.Connection;
11 import java.sql.Driver;
12 import java.sql.DriverManager;
13 import java.sql.DriverPropertyInfo;
14 import java.sql.SQLException;
15 import java.sql.SQLFeatureNotSupportedException;
16 import java.util.Properties;
17 import java.util.logging.Logger;
19 import org.opendaylight.controller.md.sal.dom.xsql.jdbc.JDBCConnection;
21 * @author Sharon Aicler(saichler@gmail.com)
23 public class JDBCDriver implements Driver {
25 public static JDBCDriver drv = new JDBCDriver();
29 DriverManager.registerDriver(this);
30 } catch (SQLException e) {
31 // TODO Auto-generated catch block
37 public boolean acceptsURL(String arg0) throws SQLException {
42 public Connection connect(String url, Properties arg1) throws SQLException {
43 System.err.println("JDBC Connection");
45 if (url.equals("svr")) {
46 return new JDBCConnection(true);
48 return new JDBCConnection(url).getProxy();
50 } catch (Exception err) {
51 err.printStackTrace();
53 System.err.println("Error JDBC Connection");
58 public int getMajorVersion() {
63 public int getMinorVersion() {
68 public DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1)
70 DriverPropertyInfo i = new DriverPropertyInfo("OpenDayLight", "OpenDayLight");
71 return new DriverPropertyInfo[] {i};
75 public boolean jdbcCompliant() {
80 public Logger getParentLogger() throws SQLFeatureNotSupportedException {
81 // TODO Auto-generated method stub