Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

MYSQL Invalid URL

115901Jul 4 2005 — edited Jul 5 2005
Is it possible that Jdev 10.1.3 Preview does not support MySQL to auto create tables and cmp fields?

I am able to connect and deploy ejb's using MySQL with JDEV 10g but not JDev 10.1.3 Preview. I am using mysql-connector-java-3.1.10-bin.jar. I placed it in j2ee/home/applib

I have tried every possible combination I have read in these forums and still cannot get it to work. In the Preview IDE, I successfully connect to the database and browse it, but when I deploy an ejb to the embedded oc4j or standalone, I get the error:

WARNING: Warning: Exception occurred getting database schema. Exception: oracle.oc4j.rmi.OracleRemoteException: SQL Error opening DataSource: Io exception: The Network Adapter could not establish the connection; nested exception is: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection; nested exception is:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

Jul 4, 2005 8:58:03 PM com.evermind.server.Application getDatabaseSchema

WARNING: Warning: Exception occurred getting database schema. Exception: oracle.oc4j.rmi.OracleRemoteException: SQL Error opening DataSource: Invalid Oracle URL specified; nested exception is: java.sql.SQLException: Invalid Oracle URL specified; nested exception is:
java.sql.SQLException: Invalid Oracle URL specified
etc......


This is what is currently shown in my IDEConnections.xml. Keep in mind that I have tried every url combination I can think of, with port/without port, computer name vs. localhost, params/no params etc...

<connection>
<URL>jdbc:mysql://localhost:3306/test?&ultraDevHack=true&capitalizeTypeNames=true&pedantic=true</URL>
<ConnectionName>MySQL</ConnectionName>
<user>root</user>
<ConnectionType>OTHER_JDBC</ConnectionType>
<password>xxxx</password>
<DeployPassword>true</DeployPassword>
<JdbcDriver>com.mysql.jdbc.Driver</JdbcDriver>
</connection>

Currently there is nothing in my data-sources.xml which appears to use a different schema than the current 10g production version. I wasn't sure how to set it up or whether to update j2ee/home/config/data-sources.xml or system\oracle.j2ee.10.1.3.3.51\oc4j-config\data-sources.xml or both. I briefly tried to update the j2ee/home/config version as I read in:

898235

but it made no difference. This is what I had:

<connection-pool name="MySql Connection Pool">
<connection-factory factory-class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"
user="root"
password="xxxx"
url="jdbc:mysql://localhost/test">
</connection-factory>
</connection-pool>

<managed-data-source name="MysqlConnectionPoolDataSource"
connection-pool-name="MySql Connection Pool"
jndi-name="jdbc/MySqlPooledDS"/>

The documentation at MySQL shows that data-sources.xml should be coded as the following which does not seem to match the current schema being used of <connection-pool> etc.. I tried it anyways to no avail.

To use connection pooling with OrionServer, put mysql-connector-java-[version]-bin.jar in $ORION_HOME/lib and add the following to data-sources.xml:

<data-source
name="MySqlDS"

location="jdbc/MySqlPooledDS" class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource"

max-connections="100"
min-connections="5"
inactivity-timeout="200"
wait-timeout="10"
username="USERNAME"

password="PASSWORD"
url="jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=Cp1251"/>


I'd appreciate any advice I can get. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2005
Added on Jul 4 2005
2 comments
788 views