1
votes

I am trying to connect my adapter to a SQL Server 2012 Express database, but I can't quite get it right. I have downloaded a connector from here: http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx, and added it to the server\lib folder in Worklight Studio.

My definitions looks as follows:

<dataSourceDefinition>
   <driverClass>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClass
   <url>jdbc:sqlserver://localhost:1433;database=MyDB</url>
   <user>MyUser</user>
   <password>MyPassword</password>
</dataSourceDefinition>

The driver class seems to be right, but the URL don't. Can anyone point me in the right direction?

PS. My environment is as follows, worklight 6.1, jre7u45, windows 8, SQL Server 2012 Express.

1
What is the error you see in Eclipse > Views > Console > Worklight Development Server?Idan Adar
[ERROR ] FWLSE0012E: ERROR: Could not connect to database. Cannot create PoolableConnectionFactory (The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".). [project NewProject]user3114517
I have also tried disabling my firewall to rule that out as a source.user3114517
That's not a standard database port (that I know of, it is usually 3306 or so); are you sure about the port for the database?Idan Adar
Isn't 1433 standard for ms-sql?user3114517

1 Answers

1
votes

Regarding the connection error, see if the following will help: