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 ?")

Samebug tips1

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web15174

  • via Google Groups by Douglas Myers-Turnbull, 6 months ago
    , 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
  • No database selected Error Code: 1046 Call: SELECT id, ADDED_BY_ID, CREATE_TIME, description, guid, impl_class_name, is_enabled, label, name, rb_key_description, rb_key_label, UPDATE_TIME, UPD_BY_ID, version FROM x_service_def WHERE (name = ?) bind
  • Transaction cannot proceed STATUS_COMMITTED Error Code: 0 Call: SELECT id, closed, changeSetID, dfFileVersionID FROM File.CHANGESETFILEVERSION WHERE (changeSetID = ?) bind => [1 parameter bound] Query: ReadAllQuery(name="fileVersions
  • Stack trace

    • 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 ?") at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:682) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2002) at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2738) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2691) at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:495) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1168) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1127) at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:403) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1215) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1786) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1751) at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) Caused by: java.sql.SQLException: No database selected at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2030) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1007) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:642) ... 22 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    693 times, 13 hours ago
    5 times, 2 weeks ago
    Once, 1 month ago
    Once, 2 months ago
    Once, 5 months ago
    150 more bugmates