Dynamic port

kristjan_h September 27, 2015

Hello.

I just installed this addon to try and immidiatly had a problem with setting up the connections. Does this addon not support dynamic sql ports? Am I doing something wrong?

Regards,

Kristjan

4 answers

1 accepted

0 votes
Answer accepted
kristjan_h October 1, 2015

A solution was provided to me by the PocketQuery team.

I needed to add the instance to the url to be able to use it without the port. So the final url looked like this:

jdbc:jtds:sqlserver://DBServer/TestConfluenceAddonDB;instance=TestInstance

Thanks for your help Natascha.

Regards,
Kristjan 

0 votes
kristjan_h September 28, 2015

Ok now I need to be carefull since I can only post one comment every 24 hours wink

Here is the log when I don't add the port. The test fails:
2015-09-28 11:01:02,716 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Testing database Test-DB
2015-09-28 11:01:02,716 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Testing database connection Test-DB | jdbc:jtds:sqlserver://DBServer/TestConfluenceAddon | net.sourceforge.jtds.jdbc.Driver | confluence
2015-09-28 11:01:02,716 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Trying to load database driver net.sourceforge.jtds.jdbc.Driver
2015-09-28 11:01:02,716 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: I could load the driver =)
2015-09-28 11:01:02,716 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Trying to connect to database...
2015-09-28 11:01:03,732 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: There was an SQLException when testing the connection =(. Info: Network error IOException: Connection refused: connect, java.sql.SQLException: Network error IOException: Connection refused: connect
2015-09-28 11:01:03,732 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Failed to connect to database Test-DB!
2015-09-28 11:01:03,732 DEBUG [http-nio-8090-exec-19] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: There was an error: I cannot connect to this database. For inspection, add a logging entry with level debug and class "de.scandio.confluence.plugins.pocketquery.util.LogUtil" at Confluence Admin => "Logging and Profiling". PocketQuery will then log information to atlassian-confluence.log.


Here is the log when I add the port 49426 (which I saw was the port currently used in the dynamic pool). The test passes. I can also set a fixed port and use that (not dynamic):
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Testing database Test-DB
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Testing database connection Test-DB | jdbc:jtds:sqlserver://DBServer:49426/TestConfluenceAddon | net.sourceforge.jtds.jdbc.Driver | confluence
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Trying to load database driver net.sourceforge.jtds.jdbc.Driver
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: I could load the driver =)
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Trying to connect to database...
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Oh yes, I can connect =)
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: Connection to database Test-DB successful!
2015-09-28 11:15:03,621 DEBUG [http-nio-8090-exec-4] [plugins.pocketquery.util.LogUtil] debug ====> PocketQuery says: New message: Oh yes, I can connect to this database!

The difference is the url
jdbc:jtds:sqlserver://DBServer/TestConfluenceAddon
jdbc:jtds:sqlserver://DBServer:49426/TestConfluenceAddon

You can send me an email so I can give better info (more frequent than 1 every 24 hours) "kristjanh (at) fivedegrees.is".

Regards,
Kristjan

0 votes
Natascha Singer September 27, 2015

Hi,

Thank you for your interest in PocketQuery! Could you please post an excerpt from the logfile showing the error message? This could help us to narrow down the cause of the problem.

Thanks

Natascha

kristjan_h September 30, 2015

Hi. Did you see my reply? Is maybe a limitation in the jtds library? Regards, Kristjan

0 votes
kristjan_h September 27, 2015

Might add that I'm trying to connect to MS SQL 2008 and 2012 with same problem. If I set the sql port to 1433 (not dynamic) on the server and include the port in the PocketQuery Url then it works. If I use dynamic ports on the server then it does not work (with or without the port in the url). It makes this addon a bit useless for me since all the company sql servers are using dynamic ports. Please, if you have a solution let me know.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events