User27854
User27854

Reputation: 884

createSQLException Error while in Configuring Data Source with Weblogic

I am trying to configure DataSources with WebLogic 10.3 and database is MySQL Server 5.5 , On entering the following

Driver Class Name ="com.mysql.jdbc.Driver"

url =jdbc:mysql://localhost:3306/weblogicdb

Database User Name =root (User name of Database MySql Server)

Password =123(Password name of Database MySql Server)

Confirm Password =123

and on clicking TestConfiguration, I get the following error.

    Connection test failed.

    Message icon - Error Unknown database 'weblogicdb'<br/>com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)
    <br/>com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2864)
    <br/>com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:806)
    <br/>com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3263)
    <br/>com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)
    <br/>com.mysql.jdbc.Connection.createNewIO(Connection.java:2638)
    <br/>com.mysql.jdbc.Connection.<init>(Connection.java:1525)
    <br/>com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:260)
    <br/>com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:505)
    <br/>com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:369)
    <br/>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    <br/>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>java.lang.reflect.Method.invoke(Method.java:597)
    <br/>org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
    <br/>org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
    <br/>org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
    <br/>org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
    <br/>org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
    <br/>org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:52)<br/>...

I was looking into many blogs and previously asked questions, where they it could be because of username and password being incorrect. But that is not the issue in my case, I have rechecked it. on using the same username and password, I was able to log into my MySQL database.

Kindly help me in configuring the system.

Upvotes: 0

Views: 437

Answers (1)

Ravinder Reddy
Ravinder Reddy

Reputation: 23982

Error stack clearly says that:

Message icon - Error Unknown database 'weblogicdb'

It seems you have input a wrong database name.

You might be succeeding with username/passwords to MySQL server.
But the server might have multiple databases in it and 'weblogicdb' is not the correct database name you are trying to connect to.

To see what databases the MySQL Server has in it, execute the following command either using java or any other MySQL clients like MySQL command line, SQLyog, PHPMyAdmin etc.

show databases();

This statement should result all the databases available.
Identify the appropriate one for your program and use the same in your code.

To connect through java to execute the above statement, db url should be:

url =jdbc:mysql://localhost:3306/?user=usernamevalue&password=passwordvalue

Upvotes: 1

Related Questions