java.sql.SQLException: No database selected Error Code: 1046 Call: SELECT WID, Absorption, CASNumber, Clearance, Created, DataSet_WID, Description, HalfLife, Id, Indication, MechanismOfAction, Name, Pharmacology, ProteinBinding, RouteOfElimination, SynthesisRef, Toxicity, Type, Updated, VolumeOfDistribution FROM DrugBank WHERE Id LIKE ? bind => [1 parameter bound] Query: ReadAllQuery(referenceClass=DrugBank sql="SELECT WID, Absorption, CASNumber, Clearance, Created, DataSet_WID, Description, HalfLife, Id, Indication, MechanismOfAction, Name, Pharmacology, ProteinBinding, RouteOfElimination, SynthesisRef, Toxicity, Type, Updated, VolumeOfDistribution FROM DrugBank WHERE Id LIKE ?")

Google Groups | Douglas Myers-Turnbull | 2 years ago
  1. 0

    Using the Java API; "No database selected" exception

    Google Groups | 2 years ago | Douglas Myers-Turnbull
    java.sql.SQLException: No database selected Error Code: 1046 Call: SELECT WID, Absorption, CASNumber, Clearance, Created, DataSet_WID, Description, HalfLife, Id, Indication, MechanismOfAction, Name, Pharmacology, ProteinBinding, RouteOfElimination, SynthesisRef, Toxicity, Type, Updated, VolumeOfDistribution FROM DrugBank WHERE Id LIKE ? bind => [1 parameter bound] Query: ReadAllQuery(referenceClass=DrugBank sql="SELECT WID, Absorption, CASNumber, Clearance, Created, DataSet_WID, Description, HalfLife, Id, Indication, MechanismOfAction, Name, Pharmacology, ProteinBinding, RouteOfElimination, SynthesisRef, Toxicity, Type, Updated, VolumeOfDistribution FROM DrugBank WHERE Id LIKE ?")
  2. 0

    java.sql.SQLException: No database selected Exception when connecting via tomcat

    Stack Overflow | 2 years ago
    java.sql.SQLException: No database selected
  3. 0

    JPA/Hibernate with InheritanceType.JOINED doing select on subclass

    Stack Overflow | 5 years ago | Ren
    org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [select coach0_.UserId as id0_, coach0_1_.firstName as firstName0_, coach0_1_.surname as surname0_, coach0_1_.email as email0_, coach0_1_.organization as organiza5_0_, coach0_1_.hashedPassword as hashedPa6_0_, coach0_1_.confirmedRegistration as confirme7_0_ from Coach coach0_ inner join User coach0_1_ on coach0_.UserId=coach0_1_.id]; SQL state [3D000]; error code [1046]; could not execute query; nested exception is org.hibernate.exception.GenericJDBCException: could not execute query
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    No database selected GAE

    Stack Overflow | 2 years ago | code578841441
    java.sql.SQLException: No database selected

  1. Kialandei 1 times, last 2 weeks ago
  2. poroszd 1 times, last 1 year ago
11 unregistered visitors
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
    PreparedStatement.executeQuery
    1. com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
    2. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
    3. com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
    4. com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
    5. com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
    6. com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530)
    7. com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907)
    8. com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2030)
    8 frames
  3. EclipseLink (non-OSGi)
    QueryImpl.executeReadQuery
    1. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1007)
    2. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:642)
    3. org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
    4. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:682)
    5. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558)
    6. org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2002)
    7. org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
    8. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
    9. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
    10. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299)
    11. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694)
    12. org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2738)
    13. org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2691)
    14. org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:495)
    15. org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1168)
    16. org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
    17. org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127)
    18. org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403)
    19. org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215)
    20. org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    21. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    22. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786)
    23. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751)
    24. org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    24 frames