1 26 package org.objectweb.jonas.jdbc; 27 28 import java.sql.DatabaseMetaData ; 29 import java.sql.SQLException ; 30 31 import javax.resource.ResourceException ; 32 33 40 public class MetaDataImpl 41 implements javax.resource.spi.ManagedConnectionMetaData { 42 43 private ManagedConnectionImpl mcon; 44 private DatabaseMetaData dMetaData; 45 46 public 47 MetaDataImpl(ManagedConnectionImpl _mcon) 48 throws ResourceException { 49 dMetaData = null; 50 try { 51 mcon = _mcon; 52 dMetaData = mcon.connection.getMetaData(); 53 } catch (SQLException se) { 54 throw new ResourceException (se.getMessage()); 55 } 56 } 57 58 62 public 63 String getEISProductName() throws ResourceException 64 { 65 try { 66 return(dMetaData.getDatabaseProductName()); 67 } catch (SQLException se) { 68 throw new ResourceException (se.getMessage()); 69 } 70 } 71 72 76 public 77 String getEISProductVersion() throws ResourceException 78 { 79 try { 80 return(dMetaData.getDatabaseProductVersion()); 81 } catch (SQLException se) { 82 throw new ResourceException (se.getMessage()); 83 } 84 } 85 86 92 public 93 int getMaxConnections() throws ResourceException 94 { 95 try { 96 return(dMetaData.getMaxConnections()); 97 } catch (SQLException se) { 98 throw new ResourceException (se.getMessage()); 99 } 100 } 101 102 109 public 110 String getUserName() throws ResourceException 111 { 112 try { 113 return(dMetaData.getUserName()); 114 } catch (SQLException se) { 115 throw new ResourceException (se.getMessage()); 116 } 117 } 118 } 119 | Popular Tags |