⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlsecurity.java

📁 导出ORACLE数据库对象DDL语句的程序
💻 JAVA
字号:
package com.icbcsdc.ddlexp.pub.xml.nodeinfo;

import java.io.InputStream;
import java.sql.CallableStatement;

import org.w3c.dom.Element;

import com.icbcsdc.ddlexp.pub.staticLog.Logger;
import com.icbcsdc.ddlexp.pub.connectionpool.JDBCCnn;
import com.icbcsdc.ddlexp.pub.connectionpool.JDBCPool;
import com.icbcsdc.ddlexp.pub.connectionpool.JDBCPoolManager;

import sun.security.krb5.internal.crypto.e;

/**
import com.icbcsdc.ddlexp.pub.xml.XmlException;
import com.icbcsdc.ddlexp.pub.xml.XmlReader;
**/

/**
 * @author zhangyc
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class XMLSecurity extends XMLNode {
	public static String NAME="Security";
	
	public XMLSecurity() throws NodeException{
		super();
		this.name=NAME;
	}
	
	/**
	 * @see com.mysqlecc.pub.xml.XmlProcess.XMLNode#getType()
	 */
	public int getType() {
		return XMLNode.XML_SECURITY;
	}

	/**
	 * @see com.mysqlecc.pub.xml.XmlProcess.XMLNode#refresh()
	 */
	public void refreshDDLInfo() throws Exception{
		JDBCPool cnn=null;
		//try {
		XMLDatabase db=this.getDatabase();

		if(db!=null) cnn = db.getConnPool();
		else return;

		this.addChild(new XMLUsers());
		this.addChild(new XMLRoles());

		if(db.getVersion() == XMLDatabase.VERSION_ORACLE8I){
			String sqlGenDDL = "BEGIN GEN_GRNT_DDL; END;";
			CallableStatement cStmt = cnn.prepareCall(sqlGenDDL);
			cStmt.execute();
			cStmt.close();
		}
		
		//super.refresh();
	}

	/**从数据库中获取数据对象比较后的结果*/
	public void refreshChangedProperties(){
	}
	

	/**
	 * @see com.icbcsdc.ddlexp.pub.xml.nodeinfo.XMLNode#refresh()
	 */
	public void refresh() throws Exception{
		refreshNodeNeedAccessDB();		
		super.refresh();
	}

	/**
	 * Manager类型的节点下面只能添加Database类型的节点
	 * */
	public boolean chkChildType(XMLNode node){
		if(node.getType()==XMLNode.XML_USERS) return true;
		if(node.getType()==XMLNode.XML_ROLES) return true;

		return false;
	}

/**
	public InputStream getXmlStream(){
        String xml="";
        try {
            writer.newDocumnet();
            Element root=writer.createRoot("security");
            root.setAttribute("name",this.getName());
            xml=writer.toString();
        } catch (XmlException e) {
			e.printStackTrace();
        }
        return XmlReader.streamFromString(xml);
	
	}
**/

	/**
	 * Returns the 返回定义导出语句.
	 * @return String
	 */
	public String getSqlDDL(){
		return null;	
	}

	public static void main(String[] args) {
	}
}

⌨️ 快捷键说明

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