Database Connection to MS SQL Server 2008 r2 Express

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Neilp
Ebase User
Posts: 2
Joined: Fri Dec 02, 2011 2:45 pm
Location: Lymington

Database Connection to MS SQL Server 2008 r2 Express

#1

Postby Neilp » Mon Mar 26, 2012 1:08 pm

Hi there,

I have been trying to setup a connection to a local SQL server database. The database is a new install (MS SQL Server 2008 r2 Express) and I can connect to it using ODBC. However when I try to setup the connection in the UFS.xml file it doesn't work.

Any thoughts...Can I connect to an SQL Express server? The version of Ebase is 4.2.2 community edition.

Cheers.

Neil
0 x

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#2

Postby ehmd » Mon Mar 26, 2012 3:16 pm

Neil,

I'm taking a guess that you've installed MS SQL Server 2008 r2 Express using the defaults on the setup.

This installs Sql Server in a named instance, which requires a change to the setup connection. You need to specify the instance name in the connection string.

Code: Select all

   <Resource name="jdbc/MYDB" auth="Container" type="javax.sql.DataSource"
			factory="com.ebase.jndi.DataSourceFactory" url="jdbc&#58;jtds&#58;sqlserver&#58;//localhost/mydb;instance=SQLEXPRESS;
			driverClassName="net.sourceforge.jtds.jdbc.Driver" username="yourusername" password="yourpassword"
			maxIdle="10" maxActive="200" validationQuery="select 1;" checkLevel="2" preparedStatementCache="16"/>
When you connect to Sql Server Management Studio, you will be prompted to connect to something like MYPCNAME/SQLEXPRESS.

The bit after the / is the Instance name which needs setting in the url above.

Hope this helps,


Mark
0 x

Neilp
Ebase User
Posts: 2
Joined: Fri Dec 02, 2011 2:45 pm
Location: Lymington

#3

Postby Neilp » Tue Mar 27, 2012 6:45 am

Thanks for your reply Mark.

I have tried setting the connection string as you suggest but unfortunately it still isn't working. Any other thoughts?

Cheers.

Neil
0 x

ehmd
Ebase User
Posts: 53
Joined: Thu Sep 13, 2007 9:02 am
Contact:

#4

Postby ehmd » Tue Mar 27, 2012 7:23 am

Have you enabled the TCP/IP protocol on Sql Server ?

Under Sql Server Configuration Manager -> Sql Server Network Configuration -> Protocols For SQLXXXXX -> TCP/IP should be set to Enabled.

Check the properties for TCP/IP by right-clicking on TCP/IP then Properties.
On the Protocol Tab ensure Protocol is enabled and on the IP Addresses Tab ensure the IP Address you are connecting to is enabled and listening.

If you make any changes to Sql Server configuration, make sure you save them and restart Sql Server.

Also check is that your connection from Ebase is not being blocked by any Firewall or Proxy Server.

Finally is the database username and password correct in the connection string, ie can you connect to the database using Sql Server Management Studio using theses ?
Does the database user have sufficient rights to the database ?
0 x


Who is online

Users browsing this forum: No registered users and 44 guests