java.sql.SQLException: No database selected

  1. 0

    CMP Entity Beans and MySQL

    Google Groups | 1 decade ago | Lukasz Szelag
    java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"ID", q1."RATING", q1."COMMENT1", q1."DATE1", q1."GUESTBOOK"
  2. 0

    Bind database to existing JBDC Connection

    Stack Overflow | 2 years ago | Roemer Bakker
    java.sql.SQLException: No database selected
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    dbname in the jdbc url not reconginized

    GitHub | 2 years ago | hepin1989
    java.sql.SQLException: No database selected

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      No database selected

      at com.mysql.jdbc.SQLError.createSQLException()
    2. MySQL jdbc
      PreparedStatementWrapper.executeQuery
      1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
      2. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
      3. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
      4. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
      5. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
      6. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
      7. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
      8. com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1962)
      9. com.mysql.jdbc.jdbc2.optional.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:530)
      9 frames
    3. Embedded GlassFish Web
      PreparedStatementWrapper40.executeQuery
      1. com.sun.gjc.spi.jdbc40.PreparedStatementWrapper40.executeQuery(PreparedStatementWrapper40.java:642)
      1 frame
    4. Hibernate
      CriteriaImpl.list
      1. org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
      2. org.hibernate.loader.Loader.getResultSet(Loader.java:2123)
      3. org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)
      4. org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1887)
      5. org.hibernate.loader.Loader.doQuery(Loader.java:932)
      6. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)
      7. org.hibernate.loader.Loader.doList(Loader.java:2615)
      8. org.hibernate.loader.Loader.doList(Loader.java:2598)
      9. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2430)
      10. org.hibernate.loader.Loader.list(Loader.java:2425)
      11. org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
      12. org.hibernate.internal.SessionImpl.list(SessionImpl.java:1863)
      13. org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:365)
      13 frames
    5. com.sombra.test
      BookDAOImpl.getBooks
      1. com.sombra.test.training.dao.impl.BookDAOImpl.getBooks(BookDAOImpl.java:30)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    7. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      3 frames
    8. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      2. org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      3. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      3 frames
    9. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      2 frames
    10. com.sun.proxy
      $Proxy280.getBooks
      1. com.sun.proxy.$Proxy280.getBooks(Unknown Source)
      1 frame
    11. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    12. Spring Expression Language (SpEL)
      SpelExpression.getValue
      1. org.springframework.expression.spel.support.ReflectivePropertyAccessor$OptimalPropertyAccessor.read(ReflectivePropertyAccessor.java:628)
      2. org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:213)
      3. org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:93)
      4. org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:46)
      5. org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:372)
      6. org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:88)
      7. org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:131)
      8. org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:299)
      8 frames
    13. Spring Binding
      SpringELExpression.getValue
      1. org.springframework.binding.expression.spel.SpringELExpression.getValue(SpringELExpression.java:84)
      1 frame
    14. Spring Web Flow
      FlowHandlerAdapter.handle
      1. org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:75)
      2. org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)
      3. org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)
      4. org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)
      5. org.springframework.webflow.engine.ActionList.execute(ActionList.java:154)
      6. org.springframework.webflow.engine.ViewState.render(ViewState.java:291)
      7. org.springframework.webflow.engine.ViewState.refresh(ViewState.java:242)
      8. org.springframework.webflow.engine.ViewState.resume(ViewState.java:220)
      9. org.springframework.webflow.engine.Flow.resume(Flow.java:537)
      10. org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)
      11. org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)
      12. org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:228)
      12 frames
    15. org.springframework.faces
      JsfFlowHandlerAdapter.handle
      1. org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:57)
      1 frame
    16. Spring MVC
      FrameworkServlet.doGet
      1. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
      2. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
      3. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
      4. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
      4 frames
    17. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      1 frame
    18. Spring MVC
      FrameworkServlet.service
      1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
      1 frame
    19. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      1 frame
    20. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      2. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
      3. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      3 frames
    21. Tyrus Servlet Bundle
      TyrusServletFilter.doFilter
      1. org.glassfish.tyrus.servlet.TyrusServletFilter.doFilter(TyrusServletFilter.java:295)
      1 frame
    22. Glassfish Core
      StandardPipeline.invoke
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      5. org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
      6. org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      6 frames
    23. Glassfish
      WebPipeline.invoke
      1. com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      1 frame
    24. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      2. org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
      3. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
      3 frames
    25. Kernel Classes
      ContainerMapper.service
      1. com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
      2. com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
      2 frames
    26. Grizzly Server
      HttpServerFilter.handleRead
      1. org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
      2. org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
      3. org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
      3 frames
    27. Grizzly
      AbstractThreadPool$Worker.run
      1. org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      2. org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      3. org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      4. org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      5. org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      6. org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      7. org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
      8. org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      9. org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
      10. org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
      11. org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
      12. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      13. org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      13 frames
    28. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame