How to connect MS Sql server in windows?

First i have one doubt im using elasticsearch 5.6.3 and jdbc is elasticsearch-jdbc-2.3.3.1.. is it fine or is it wrong??

Im using windows 7. and i installed elasticsearch 5.6.3 its shows

{strong text
"name" : "5uyIjly",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "7RUbLqDQRJGLqq-sTYwtWg",
"version" : {
"number" : "5.6.3",
"build_hash" : "1a2f265",
"build_date" : "2017-10-06T20:33:39.012Z",
"build_snapshot" : false,
"lucene_version" : "6.6.1"
},
"tagline" : "You Know, for Search"
}

after i copied jar file too.. after i run the command in bat file like

{
"type": "jdbc",
"jdbc": {
"url" : "jdbc:sqlserver://192.169.23.1/div2011;instanceName=SQLEXPRESS;databaseName=esctt",^
"user": "well",
"password": "well",
"sql": "select Top 10 * from tbl_name",
"treat_binary_as_string": true,
"elasticsearch": {
"cluster": "elasticsearch",
"host": "localhost",
"port": 9200
},
"index": "record",
"type": "record"
}
}

when im execute its shows

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>mssql-simple-example.bat

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>{
'{' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"type": "jdbc",
'"type":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"jdbc": {
'"jdbc":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"url" : "jdbc:sqlserver://
192.169.23.1/div2011;instanceName=SQLEXPRESS;databaseName=esctt",
"user": "well",
'"url"' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"password": "well",
'"password":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"sql": "select Top 10 * fr
om tbl_name",
'"sql":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"treat_binary_as_string":
true,
'"treat_binary_as_string":' is not recognized as an internal or external command
,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"elasticsearch": {
'"elasticsearch":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"cluster": "elasticsearch"
,
'"cluster":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"host": "localhost",
'"host":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"port": 9200
'"port":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>},
'}' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"index": "record",
'"index":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>"type": "record"
'"type":' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>}
'}' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>}
'}' is not recognized as an internal or external command,
operable program or batch file.

C:\elasticsearch-5.6.3\elasticsearch-jdbc-2.3.3.1\bin>

please help this

First read

The problem you have is something else I think but I prefer that you know the limits before solving something useless.

k thank u

I followed this http://hintdesk.com/how-to-connect-elasticsearch-to-ms-sql-server/

my batfile:

@echo off
set DIR=%~dp0
set LIB=%DIR%..\lib*
set BIN=%DIR%..\bin

REM ???
echo {^
“type” : “jdbc”,^
“jdbc” : {^
“url” : “jdbc:sqlserver://192.14.541/Ssme2012;instanceName=SQLEXPRESS;databaseName=ESHUN”,^
“user” : “ghud”,^
“password” : “ghud”,^
“sql” : “select Top 10 Name, Area, City from details.Person”,^
“treat_binary_as_string” : true,^
“elasticsearch” : {^
“cluster” : “elasticsearch”,^
“host” : “localhost”,^
“port” : 9200^
},^
“index” : “person”,^
“type” : “person”^
}^
}^ | “%JAVA_HOME%\bin\java” -cp “%LIB%” -Dlog4j.configurationFile=”%BIN%\log4j2.xml” “org.xbib.tools.Runner” “org.xbib.tools.JDBCImporter”
}^ | “%JAVA_HOME%\bin\java” -cp “%LIB%” -Dlog4j.configurationFile=”%BIN%\log4j2.xml” “org.xbib.tools.Runner” “org.xbib.tools.JDBCImporter”

but its not working can you please help me for this solution

i got this error:

c:\elasticsearch-2.3.3\elasticsearch-jdbc-2.3.3.1\bin>}, "index" : "person",
pe" : "person" } } | "C:\Program Files\Java\jdk1.8.0_40\bin\java"
p "c:\elasticsearch-2.3.3\elasticsearch-jdbc-2.3.3.1\bin..\lib*" -Dlog4j.co
gurationFile="c:\elasticsearch-2.3.3\elasticsearch-jdbc-2.3.3.1\bin..\bin\lo
2.xml" "org.xbib.tools.Runner" "org.xbib.tools.JDBCImporter"
'}' is not recognized as an internal or external command,
operable program or batch file.

I don't know. May be ask on https://github.com/jprante/elasticsearch-jdbc ?

okay thank you for quick response

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