# Jdbc streaming and sql error

**URL:** <https://discuss.elastic.co/t/jdbc-streaming-and-sql-error/186766>\
**Category:** Logstash\
**Created:** [June 20, 2019, 8:59pm UTC](https://discuss.elastic.co/t/jdbc-streaming-and-sql-error/186766 "2019-06-20T20:59:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan01](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jonathan01](https://discuss.elastic.co/u/jonathan01)\
**Post date:** [June 20, 2019, 8:59pm UTC](https://discuss.elastic.co/t/jdbc-streaming-and-sql-error/186766/1 "2019-06-20T20:59:24Z")

</div>

I am using the jdbc streaming and below is my code

jdbc\_streaming {  
jdbc\_driver\_library =\> "C:\logstash-7.0.0\bin\sqljdbc42.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
jdbc\_connection\_string =\> "jdbc:sqlserver://ltgsql.database.windows.net;databaseName=RHA;user=;password=;"  
jdbc\_user =\> ""  
jdbc\_password =\> ""  
parameters =\> { "hname" =\> "[agent][hostname]"}  
parameters =\> { "username" =\> "[userid]"}  
statement =\> "select SiteName,Latitude,Longitude FROM Session\_Key WHERE HostedMachineName like lower(:hname) and UserName like :username"  
target =\> "site\_data"  
}

the error that I am getting is

[2019-06-20T16:27:48,970][ERROR][logstash.javapipeline] tdsparser.java:83)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:2532)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1929)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:41)", "com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1917)", "com.microsoft.sqlserver.jdbc.TDSCommand.execute(com/microsoft/sqlserver/jdbc/IOBuffer.java:4026)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1416)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:1061)", "com.microsoft.sqlserver.jdbc.SQLServerConnection.login(com/microsoft/sqlserver/jdbc/SQLServerConnection.java:833)"

[2019-06-20T16:27:48,985][ERROR][logstash.agent] Failed to execute action {:id=\>:ltg\_beats, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: PipelineAction::Create\<ltg\_beats\>, action\_result: false", :backtrace=\>nil}

Can anyone explain what this error is.  
I thought that maybe a connection issue but I can connect to the database from this VM

thanks

---

<div class="post-metadata">

**Author:** ![jonathan01](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jonathan01](https://discuss.elastic.co/u/jonathan01)\
**Post date:** [June 21, 2019, 1:08pm UTC](https://discuss.elastic.co/t/jdbc-streaming-and-sql-error/186766/2 "2019-06-21T13:08:13Z")

</div>

As an update I found that for the sqljdbc jar file there needs to be all the libraries. So for those that need the info make sure that the jar file you download for the streaming that it has all the libraries.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 19, 2019, 1:08pm UTC](https://discuss.elastic.co/t/jdbc-streaming-and-sql-error/186766/3 "2019-07-19T13:08:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
