在eclipse中,当我开始我的应用程序时,我得到了这个 - 无法发现要使用的方言.java.sql.SQLException:无法加载身份验证插件'caching_sha2_password'.
在java.sql.SQLException:无法加载身份验证插件'caching_sha2_password'.在在com.mysql.jdbc.SQLError.createSQLException(SQLError.java:868)处com.mysql.jdbc.SQLError.createSQLException(SQLError.java:864)处com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(了MysqlIO. java:1746)at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2191)at com.mysql.jdbc.ConnectionImpl. connectOneTryOnly(ConnectionImpl.java:2222)at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2017)at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:779)at com.mysql.jdbc .JDBC4Connection(JDBC4Connection.java:47)维持在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)维持在sun.reflect.NativeConstructorAccessorImpl.newInstance(来源不明)处sun.reflect.DelegatingConstructorAccessorImpl.newInstance(来源不明)在在java.lang.reflect.Constructor.newInstance(未知来源)at at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)at a t com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)at at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)at at java.sql.DriverManager.getConnection(Unknown Source)at at at java.sql.DriverManager.getConnection(来源不明)处ch.qos.logback.core.db.DriverManagerConnectionSource.getConnection(DriverManagerConnectionSource.java:54)维持在ch.qos.logback.core.db.ConnectionSourceBase.discoverConnectionProperties(ConnectionSourceBase .java:46)at ch.qos.logback.core.db.DriverManagerConnectionSource.start(DriverManagerConnectionSource.java:38)at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:161 )at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)at at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPl)ayer.java:62)处ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)处ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)位于ch.qos的ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53). logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)处ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)处org.slf4j.impl.StaticLoggerBinder.init( StaticLoggerBinder.java:84)处org.slf4j.impl.StaticLoggerBinder.(StaticLoggerBinder.java:55)处org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)处org.slf4j.LoggerFactory.performInitialization(的LoggerFactory .java:124)at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)at ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addSta tus(StatusViaSLF4JLoggerFactory.java:32)位于ch.qos.logback.classic.util.StatusViaSLF4JLoggerFactory.addInfo(StatusViaSLF4JLoggerFactory.java:20)at ch.qos.logback.classic.servlet.LogbackServletContainerInitializer.onStartup(LogbackServletContainerInitializer.java: 32)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5245)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina. core.ContainerBase $ StartChild.call(ContainerBase.java:1421)at org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1411)at at java.util.concurrent.FutureTask.run(Unknown Source )at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)at at java.lang.Thread.run(Unknown Source)
我们可以在类B中访问类A的变量和方法,而不将类A扩展到类B.
without using
public class A
{
//body of the class
}
public class B extends A
{
}
Run Code Online (Sandbox Code Playgroud)