yoursqldriver.java

来自「原创的DBMS 数据库! 功能很简单」· Java 代码 · 共 55 行

JAVA
55
字号
package code;
import java.sql.Connection;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
import java.sql.Driver;
import java.util.Properties;
public  class yourSQLDriver implements java.sql.Driver{

	static {
	    try {
	      java.sql.DriverManager.registerDriver(new yourSQLDriver());
	    } catch (Exception e) {
	      e.printStackTrace();
	    }
	  }
	public boolean acceptsURL(String url) throws SQLException {
		// TODO Auto-generated method stub
		return true;
	}

	public Connection connect(String url, Properties info) throws SQLException {
		// TODO Auto-generated method stub
		return getConnection(info.getProperty("user"), url, this);
	}

	public int getMajorVersion() {
		// TODO Auto-generated method stub
		return 0;
	}

	public int getMinorVersion() {
		// TODO Auto-generated method stub
		return 0;
	}

	public DriverPropertyInfo[] getPropertyInfo(String arg0, Properties arg1) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean jdbcCompliant() {
		// TODO Auto-generated method stub
		return false;
	}
	
	public yourSQLConnection getConnection
    (String user, String url, Driver d) 
     throws SQLException {
	
	return  new yourSQLConnection(user, url, d);
	}
	

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?