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

📄 metadataimpl.java

📁 用Java实现的23个常用设计模式源代码
💻 JAVA
字号:
package net.sf.hibernate.jca;import java.sql.SQLException;import javax.resource.ResourceException;import javax.resource.spi.ManagedConnectionMetaData;/** * * Implementation delegates to the database connection meta data object * */public class MetaDataImpl implements ManagedConnectionMetaData {		private ManagedConnectionImpl mc;		public MetaDataImpl(ManagedConnectionImpl mc) {		this.mc = mc;	}		public String getEISProductName() throws ResourceException {		String result = null;		try {			result = mc.getConnection().getMetaData().getUserName();		}		catch (SQLException e) {			final String message = "Exception getting product name";			final ResourceException re = new ResourceException(message);			re.setLinkedException(e);			throw re;		}		return result;			}		public String getEISProductVersion() throws ResourceException {		String result = null;		try {			result = mc.getConnection().getMetaData().getDriverVersion();		}		catch (SQLException e) {			final String message = "Exception getting product version";			final ResourceException re = new ResourceException(message);			re.setLinkedException(e);			throw re;		}		return result;			}		public int getMaxConnections() throws ResourceException {		int result = 0;		try {			result = mc.getConnection().getMetaData().getMaxConnections();		}		catch (SQLException e) {			final String message = "Exception getting max connections";			final ResourceException re = new ResourceException(message);			re.setLinkedException(e);			throw re;		}		return result;			}		public String getUserName() throws ResourceException {		String result = null;		try {			result = mc.getConnection().getMetaData().getUserName();		}		catch (SQLException e) {			final String message = "Exception getting connection user name";			final ResourceException re = new ResourceException(message);			re.setLinkedException(e);			throw re;		}		return result;	}}

⌨️ 快捷键说明

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