You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by SreeAsh <sr...@fs.mphasis.com> on 2010/02/09 13:19:24 UTC

While connecting MySql Server i am getting the Error For input string: "JDBC"

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
-- 
View this message in context: http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4540703.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

RE: While connecting MySql Server i am getting the Error For input string: "JDBC"

Posted by SreeAsh <sr...@fs.mphasis.com>.
Thanks for reply,

     I given the same which you given the example in mail, but I am getting the same error.

Regards,
Srini

________________________________
From: Michael Dick [via OpenJPA] [mailto:ml-node+4541141-1472474111@n2.nabble.com]
Sent: Tuesday, February 09, 2010 7:23 PM
To: Srinivasulu.Kristnam
Subject: Re: While connecting MySql Server i am getting the Error For input string: "JDBC"

Hi Srini,

You need to replace hostname , port, and myDataBase in with the appropriate
values for your database.

For example :
<property name="openjpa.ConnectionURL"
value="jdbc:sqlserver://localhost:1433;databaseName=testDatabase"/>

Regards,
-mike


On Tue, Feb 9, 2010 at 6:19 AM, SreeAsh <[hidden email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=4541141&i=0>
> 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
> --
> View this message in context:
> http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4540703.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

________________________________
View message @ http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4541141.html
To unsubscribe from While connecting MySql Server i am getting the Error For input string: "JDBC", click here< (link removed) =>.


________________________________
Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@fs.mphasis.com and delete this mail from your records.

-- 
View this message in context: http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4545934.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: While connecting MySql Server i am getting the Error For input string: "JDBC"

Posted by Michael Dick <mi...@gmail.com>.
Hi Srini,

You need to replace hostname , port, and myDataBase in with the appropriate
values for your database.

For example :
<property name="openjpa.ConnectionURL"
value="jdbc:sqlserver://localhost:1433;databaseName=testDatabase"/>

Regards,
-mike


On Tue, Feb 9, 2010 at 6:19 AM, SreeAsh <srinivasulu.kristnam@fs.mphasis.com
> 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
> --
> View this message in context:
> http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4540703.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

Re: While connecting MySql Server i am getting the Error For input string: "JDBC"

Posted by Donald Woods <dw...@apache.org>.
Looks like your ConnectionURL is invalid for MSSQL in how you have
provided the DBName.  It should be something like -
    jdbc:sqlserver://192.168.1.100:1433;DataBaseName=OPENJPA

Also, make sure your SQL Server is using the default port of 1433 (or
supply the correct port) and that if Windows Firewall is enabled, that
you have gone in and manually opened the MSSQL port for TCP traffic.


-Donald


On 2/9/10 11:35 PM, SreeAsh wrote:
> 
> Thanks for reply,
> 
>  I am using the Microsoft Sql Server; please see the driverName in Persistence.xml file
> <persistence-unit name="TestSql" transaction-type="RESOURCE_LOCAL">
>     <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> 
>     <properties>
>       <property name="openjpa.ConnectionUserName" value="appl_id2"/>
>       <property name="openjpa.ConnectionPassword" value="appl_id2"/>
>       <property name="openjpa.ConnectionURL" value="jdbc:sqlserver://host:port/CustomerDB"/>
>       <property name="openjpa.ConnectionDriverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>       <property name="openjpa.jdbc.Schema" value="dbo"/>
>        </properties>
>   </persistence-unit>
> 
> Regards
> Srini
> 
> ________________________________
> From: DWoods [via OpenJPA] [mailto:ml-node+4541183-1974042908@n2.nabble.com]
> Sent: Tuesday, February 09, 2010 7:35 PM
> To: Srinivasulu.Kristnam
> Subject: Re: While connecting MySql Server i am getting the Error For input string: "JDBC"
> 
> 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
> 
> ________________________________
> View message @ http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4541183.html
> To unsubscribe from While connecting MySql Server i am getting the Error For input string: "JDBC", click here< (link removed) =>.
> 
> 
> ________________________________
> Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@fs.mphasis.com and delete this mail from your records.
> 

RE: While connecting MySql Server i am getting the Error For input string: "JDBC"

Posted by SreeAsh <sr...@fs.mphasis.com>.
Thanks for reply,

 I am using the Microsoft Sql Server; please see the driverName in Persistence.xml file
<persistence-unit name="TestSql" transaction-type="RESOURCE_LOCAL">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

    <properties>
      <property name="openjpa.ConnectionUserName" value="appl_id2"/>
      <property name="openjpa.ConnectionPassword" value="appl_id2"/>
      <property name="openjpa.ConnectionURL" value="jdbc:sqlserver://host:port/CustomerDB"/>
      <property name="openjpa.ConnectionDriverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
      <property name="openjpa.jdbc.Schema" value="dbo"/>
       </properties>
  </persistence-unit>

Regards
Srini

________________________________
From: DWoods [via OpenJPA] [mailto:ml-node+4541183-1974042908@n2.nabble.com]
Sent: Tuesday, February 09, 2010 7:35 PM
To: Srinivasulu.Kristnam
Subject: Re: While connecting MySql Server i am getting the Error For input string: "JDBC"

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

________________________________
View message @ http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4541183.html
To unsubscribe from While connecting MySql Server i am getting the Error For input string: "JDBC", click here< (link removed) =>.


________________________________
Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at mailmaster@fs.mphasis.com and delete this mail from your records.

-- 
View this message in context: http://n2.nabble.com/While-connecting-MySql-Server-i-am-getting-the-Error-For-input-string-JDBC-tp4540703p4545924.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Re: While connecting MySql Server i am getting the Error For input string: "JDBC"

Posted by Donald Woods <dw...@apache.org>.
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