This Question is Answered

12 Replies Last post: Jul 29, 2008 11:06 AM by Ryan Hawley  
Ryan Hawley Bronze 13 posts since
Jul 18, 2008
Currently Being Moderated

Jul 23, 2008 3:37 PM

Trouble with using SQL Express 2005

 

If someone can point me to what i am doing wrong, id appreciate it.

 

 

First databases and such are not my fortay, frankly i have little idea what i am doing, but i am a quick learner, and the documentation is just not helping me.

 

 

I have created a database, i have run the script to drop the tables and set up.  I am running the set up and it never connects.

 

 

Here is what i am putting in, i just do not know if its right, i have tried a few different ways.

 

 

jdbc:jtds:sqlserver://[server]/[SQLEXPRESS]/[Databases]/[Openfire];appName=jive

 

 

  i have changed nothing else other then to put in the user and its password, i am just using the SA account and have modified its password, and made Openfire its default database.

 

 

 

What am i doing wrong?

 

 

Bara Dude Bronze 11 posts since
Jul 23, 2008
Currently Being Moderated
Jul 24, 2008 1:28 AM in response to: Ryan Hawley
Re: Trouble with using SQL Express 2005

Hi,

 

I am new to Openfire myself but have managed to get it running with Microsoft SQL Server 2005 Express Edition SP2. First, please check whether you have MSSQL TCP/IP up and running (it's off by default). Try at Command Prompt on the server running Openfire this command "telnet hostname_or_ip_addy_of_the_sql_server 1433" and see if the connection is refused or established. If the connection is refused that means you haven't configured MSSQL TCP/IP yet. Please do so using SQL Server Configuraiton Manager. If the connection is established (you see a blank screen and not being returned to the prompt) then the problem is with your DB Connection URL. The one you are using seems to be incorrect. First, you don't need those square brackets ( [ ] ) in the URL. Then it's the server name and the instance name. I had this problem myself and it took a while to figure out. In my case I did not create a new DB under the instance SQLExpress but instead used the default one. The default database for user "sa" is the database called master and that's where the script "C:\Program Files\Openfire\resources\database\openfire_sqlserver.sql" was executed to create the tables. With the help of the error.log file in "C:\Program Files\Openfire\logs" I finally found that the URL in my case would have to be simply jdbc:jtds:sqlserver://localhost/;appName=jive (as Openfire is on the same server as MSSQL Express).

 

Hope this helps. In any case please let us know.

 

Cheers!

Bara Dude Bronze 11 posts since
Jul 23, 2008
Currently Being Moderated
Jul 24, 2008 9:49 PM in response to: Ryan Hawley
Re: Trouble with using SQL Express 2005

I had similar error but proably on a different step and it was due to a session timeout. Did you try starting it over?

 

I still don't think you need SQLEXPRESS in the URL. My understanding is one instance can only have one TCP port thus you specify only the port number (correct me if I am wrong as MSSQL isn't my forte either). Anyways, do let us know if it works.

 

Also I am not sure how you came up with the port number 7378. In my case I put the default port number 1433 as TCP Port under IPAll section of IP Addresses tab of TCP/IP Properties dialog. I also changed Enabled field from No to Yes for both IP1 and IP2 and changed TCP Dynamic Ports to 0. Is 7378 the TCP Dynamic Ports in your case?

 

I would recommend using SQL Server Management Studio Express to connect to the database via TCP/IP and logon as "sa" (as opposed to using DOMAIN\Administrator). That will confirm whether the database is accessible via TCP/IP. You could try it on the same server where the database resides or even better try it from a different computer. Good luck.

 

Cheers!

seth Bronze 7 posts since
Feb 29, 2008
Currently Being Moderated
Jul 24, 2008 9:59 PM in response to: Bara Dude
Re: Trouble with using SQL Express 2005

Here's a couple of other places to check:

 

Open up your SQL Server Configuration Manager and make sure the SQL Server Browser is turned on. Also make sure that TCP/IP is enabled -- if you're not using any other apps with SQL Server, you may as well turn off Shared Memory, Named Pipes & VIA too. Then take a look under SQL Native Client Configuration -> TCP/IP, right click it and look at Properties. The "Default Port" will tell you what port SQL Server is listening to.

 

Also, you'll need to make sure that your server is configured for mixed mode authentication (Windows and Sql Server auth). You can do this in SQL Server Management Studio Express. Connect the object explorer to your server (with Windows authentication, if necessary), right click on the database, choose properties, then look at Security, and click on "SQL Server and Windows Authentication mode".

 

You can also use SQL Server Management Studio Express to verify that your OpenFire user is able to login and can see the database.

 

Cheers,

 

- Seth -

Bara Dude Bronze 11 posts since
Jul 23, 2008
Currently Being Moderated
Jul 29, 2008 12:13 AM in response to: Ryan Hawley
Re: Trouble with using SQL Express 2005

It says "Connection refused" meaning the port isn't open on the MS SQL server side or an incorrect port is specified on the Openfire side.

 

First, try "netstat -an | findstr LISTENING" and see if you have your port open. Second, what's the DB URL you are using?

Bara Dude Bronze 11 posts since
Jul 23, 2008
Currently Being Moderated
Jul 29, 2008 10:55 AM in response to: Ryan Hawley
Re: Trouble with using SQL Express 2005

Try the following URL and if it still doesn't work let's see the error log.

 

jdbc:jtds:sqlserver://SERVERNAME:7378/;appName=jive

Mozzy Thor Bronze 7 posts since
Jul 28, 2008
Currently Being Moderated
Jul 29, 2008 11:00 AM in response to: Ryan Hawley
Re: Trouble with using SQL Express 2005

The problem is that you need to open your "SQL Server Configuration Manager" tool and make sure you have enabled port 1433 to listen on the correct network device.  Once you get it enabled then it will show up in your netstat and it will allow remote connections...

 

SQL 2005, by default, doesnt have that port service enabled.    Also, when you reference your SQL instance you might need to refer to it as "MYMACHINE\SQLEXPRESS"  .

 

You'll probably need something like this:

 

jdbc:jtds:sqlserver://SERVERNAME:1433;instance=SQLEXPRESS;appName=jive

More Like This

  • Retrieving data ...