congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DatasourceConnectionProviderImpl.getDataSource
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataSource
method
in
org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl

Best Java code snippets using org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getDataSource (Showing top 3 results out of 315)

origin: hibernate/hibernate-orm

@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
  if ( ConnectionProvider.class.equals( unwrapType ) ||
      DatasourceConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
    return (T) this;
  }
  else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
    return (T) getDataSource();
  }
  else {
    throw new UnknownUnwrapTypeException( unwrapType );
  }
}
origin: org.hibernate.orm/hibernate-core

@Override
@SuppressWarnings( {"unchecked"})
public <T> T unwrap(Class<T> unwrapType) {
  if ( ConnectionProvider.class.equals( unwrapType ) ||
      DatasourceConnectionProviderImpl.class.isAssignableFrom( unwrapType ) ) {
    return (T) this;
  }
  else if ( DataSource.class.isAssignableFrom( unwrapType ) ) {
    return (T) getDataSource();
  }
  else {
    throw new UnknownUnwrapTypeException( unwrapType );
  }
}
origin: stackoverflow.com

 SessionFactoryImpl factory = (SessionFactoryImpl) session.getSessionFactory(); // or directly cast the sessionFactory
DatasourceConnectionProviderImpl provider = (DatasourceConnectionProviderImpl)factory.getConnectionProvider();
DataSource dataSource = provider.getDataSource();
org.hibernate.engine.jdbc.connections.internalDatasourceConnectionProviderImplgetDataSource

Popular methods of DatasourceConnectionProviderImpl

  • <init>
  • configure
  • setDataSource
  • getConnection
  • closeConnection
  • isUnwrappableAs
  • stop

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now