openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: While connecting MySql Server i am getting the Error For input string: "JDBC"
Date Tue, 09 Feb 2010 14:03:58 GMT
Are you trying to connect to a Microsoft SQL Server or a MySQL server?
Your email says MySQL, but the error message shows you are trying to use
the Microsoft SQL Server driver....

For MySQL, you would use -
<property name="openjpa.ConnectionDriverName"
value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionURL"
value="jdbc:mysql://<SERVER_NAME>/<DB_NAME>"/>

where <SERVER_NAME> is the IP Address of your MySQL server and <DB_NAME>
is the DB name to connect to.



-Donald


On 2/9/10 7:19 AM, SreeAsh wrote:
> 
> Hi ,
> 
>   I am new to the JPA, I am using the MySql Server to OpenJPa, while
> connecting to the databse throwing the following error.
> 
> 
> <openjpa-1.2.0-r422266:683325 fatal user error>
> org.apache.openjpa.util.UserException: A connection could not be obtained
> for driver class "com.microsoft.sqlserver.jdbc.SQLServerDriver" and URL
> "jdbc:sqlserver://host\port;databaseName=MyDataBase".  You may have
> specified an invalid URL.
> Error For input string: "JDBC" and in
> 
> pelase see the persistence.xml file
> 
> <persistence-unit name="TestJpaPU" transaction-type="RESOURCE_LOCAL">
>    
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
>     <class>com.test.jpa.TblCustAddress</class>
>     <class>com.test.jpa.TblCustContact</class>
>     <class>com.test.jpa.TblCustomer</class>
>     <properties>
>       <property name="openjpa.ConnectionUserName" value="user"/>
>       <property name="openjpa.ConnectionPassword" value="pass"/>
>       <property name="openjpa.ConnectionURL"
> value="jdbc:sqlserver://host\port;databaseName=Mydatabase"/>
>       <property name="openjpa.ConnectionDriverName"
> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>     </properties>
>   </persistence-unit>
> 
> please help me to fix this issue....
> 
> regsrds
> Srini

Mime
View raw message