web stats
need help connecting to aws RDS - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2018, 03:43 PM
kregulapati kregulapati is offline
Mirth Newb
 
Join Date: Oct 2018
Posts: 6
kregulapati is on a distinguished road
Default need help connecting to aws RDS

hi,
i am trying to connect to AWS RDS database using a datareader and its giving me connection failure error.

following code i am using.

var dbConn;

try {
dbConn = DatabaseConnectionFactory.createDatabaseConnection (''net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sq lserver://***********us-east-1.rds.amazonaws.com:1433;databaseName=****QA;ssl=r equire;','*****','****');
var Query = "select 1'";
var result = dbConn.executeCachedQuery(Query);
// You may access this result below with $('column_name')
return result;
} finally {
if (dbConn) {
dbConn.close();
}
}

Following is the error i got.
Could not retrieve database metadata. Please ensure that your driver, URL, username, and password are correct.

Method failed: HTTP/1.1 500 Internal Server Error
com.mirth.connect.client.core.ClientException: Method failed: HTTP/1.1 500 Internal Server Error
at com.mirth.connect.client.core.ServerConnection.han dleResponse(ServerConnection.java:529)
at com.mirth.connect.client.core.ServerConnection.han dleResponse(ServerConnection.java:453)
at com.mirth.connect.client.core.ServerConnection.exe cuteAsync(ServerConnection.java:302)
at com.mirth.connect.client.core.ServerConnection.app ly(ServerConnection.java:168)
at org.glassfish.jersey.client.ClientRuntime.invoke(C lientRuntime.java:255)
Reply With Quote
  #2  
Old 11-09-2018, 03:59 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

Maybe because you aren't specifying a database before running a query? It should be after your port and before your properties.

Code:
jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]
If you don't do it in the connection string, I expect you would need to specify one before running a query.
Reply With Quote
  #3  
Old 11-09-2018, 04:03 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

These might also be relevant:
https://www.mirthcorp.com/community/...ead.php?t=8263
http://www.mirthproject.org/communit...d.php?t=216465
Reply With Quote
  #4  
Old 11-10-2018, 05:35 AM
kregulapati kregulapati is offline
Mirth Newb
 
Join Date: Oct 2018
Posts: 6
kregulapati is on a distinguished road
Default need help connecting to aws RDS

i have db name on the connectionstring. you can look at my previous post. i tried giving the way you said also. it dint work. if i connect a normal sql server database it works fine. only RDS instance when i try to connect it gives me error. i checked the credentials i can connect with ssms to the same rds instance, but mirth giving me errors. i removed the encryption also on the server to see if thats the issue.

getting the error.

n error occurred while initializing the connection, retrying after 10000 ms...
java.sql.SQLException: I/O Error: DB server closed connection.
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2481)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.ja va:632)
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Jt dsConnection.java:371)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.ja va:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.mirth.connect.connectors.jdbc.DatabaseReceiver Query.initSelectConnection(DatabaseReceiverQuery.j ava:340)
at com.mirth.connect.connectors.jdbc.DatabaseReceiver Query.initConnection(DatabaseReceiverQuery.java:10 1)
at com.mirth.connect.connectors.jdbc.DatabaseReceiver Query.start(DatabaseReceiverQu

java.sql.SQLException: I/O Error: DB server closed connection.

at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2481)

at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.ja va:632)

at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(Jt dsConnection.java:371)

at net.sourceforge.jtds.jdbc.Driver.connect(Driver.ja va:184)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at com.mirth.connect.connectors.jdbc.DatabaseReceiver Query.initSelectConnection(DatabaseReceiverQuery.j ava:340)

at com.mirth.connect.connectors.jdbc.DatabaseReceiver Query.initConnection(DatabaseReceiverQuery.java:10 1)

do you have steps to install sql server driver? i can try with that.

Last edited by kregulapati; 11-10-2018 at 05:36 AM. Reason: missed a word.
Reply With Quote
  #5  
Old 11-10-2018, 08:40 AM
kregulapati kregulapati is offline
Mirth Newb
 
Join Date: Oct 2018
Posts: 6
kregulapati is on a distinguished road
Default need help connecting to aws RDS

i see this error in the RDS Logs.

Logon Encryption is required to connect to this server but the client library does not support encryption; the connection has been closed. Please upgrade your client library.
Reply With Quote
  #6  
Old 11-10-2018, 09:33 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

You might want to give the microsoft driver a try instead of using jtds
Reply With Quote
  #7  
Old 11-10-2018, 12:09 PM
kregulapati kregulapati is offline
Mirth Newb
 
Join Date: Oct 2018
Posts: 6
kregulapati is on a distinguished road
Default need help connecting to aws RDS

How do you install the microsoft driver and what do you need to update in dbdrivers.xml.

BTW i am suing mirth connect 3.6.1 with java 8.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Mirth Corporation