Logstash Import by jdbc fail to connect to sqlServer Express [duplicate] - elasticsearch

Is it possible to connect to a SQL Server LocalDB using JDBC? It appears that (as of Dec 2011) it was not possible.
Do you know of a workaround or change in status?

Yes, it is possible.
The connection string for a LocalDB instance using jTDS looks like this:
jdbc:jtds:sqlserver://./DatabaseName;instance=LOCALDB#88893A09;namedPipe=true
This works as of jTDS 1.3.2. You can download a release here:
https://github.com/milesibastos/jTDS/releases/download/v1.3.2/jtds-1.3.2-dist.zip
To find the named pipe for your desired LocalDB, run
SqlLocalDb info NameOfTheLocalDBInstance
which will give you something like np:\\.\pipe\LOCALDB#88893A09\tsql\query
It's probably best to connect with a specific username/password, so create a login and user for your database in that LocalDB instance as well (if you haven't already):
sqlcmd -S np:\\.\pipe\LOCALDB#88893A09\tsql\query
CREATE LOGIN dbuser WITH PASSWORD = 'dbpassword'
GO
CREATE USER dbuser
GO
ALTER AUTHORIZATION ON DATABASE::DatabaseName TO dbuser
GO

Is it possible to connect to a SQL Server LocalDB using JDBC?
Not with Microsoft's JDBC Driver.
The jTDS JDBC driver supports named pipes.
Executing SqlLocalDB.exe info MyInstance will get you (along with other info) the instance pipe name such as "np:\.\pipe\LOCALDB#F365A78E\tsql\query".
Do you know of a workaround or change in status?
Possible workarounds are using alternative JDBC drivers or switching to SQL Server 2012 Express instead of LocalDB.
Details:
The Microsoft JDBC Driver is not compatible with LocalDB.
"Unfortunately, the Microsoft JDBC Driver does not support connecting to LocalDB. This happens because LocalDB only supports Named Pipes connections and our current JDBC implementation does not support Named Pipes. One possible work around for your developers is to download and install SQL Express, which and enable its TCP/IP support."
Luiz Fernando Santos (MSFT) July 06, 2012
"Unfortunately JDBC driver doesn't support LocalDB at this moment and there is no easy workaround. The team is aware of this missing feature, but filing a connect item is always helpful for DCR tracking and prioritization."
Krzysztof Kozielczyk - MSFT 22 Dec 2011
"Do you use SQL Server Express today for local development? Are you working on Windows or another platform? It would be great to hear more about how you would like to use LocalDB with your Java app."
Shamitha Reddy, Program Manager Microsoft JDBC Driver for SQL Server, Microsoft JDBC Driver Product Team 13 Apr 2012

I did my research today to setup connection using jTDS and named pipes.
The state at today is: IMPOSSIBLE!
There is not possible to build connect string to localDB using jTDS due to its pipe name limitations. See open issue here: http://sourceforge.net/p/jtds/bugs/716/
As mentioned localDB does not supports other connection but namedPipes, so it looks like mission impossible so far...
rgds
Edit:
As mentioned in comment there is patch in issue linked above and you can use this to fix the problem. Sorry I can not check this for myself.

To Know LocalDb & Instance :
Right click on LocalDb in Object explorer
Select Properties
click on view connection properties
you will get all information about local and webserver details

Related

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

Connect from SSIS to Oracle using ODBC with Kerberos

We have a large SSIS solution with many connection managers pointing to Oracle. Provider is ODBC, data sources are set to defined system DSNs. So far we use user names and passwords and everything works fine. Now we want to switch to Kerberos authentication.
I can already successfully query the Oracle database using sqlplus with Windows authentication.
I'm having hard time achieving the same from SSIS using ODBC connection managers.
Is it possible to reconfigure the ODBC connection managers so they will use Windows authentication? How should be the connection manager configured?
The question is specifically about ODBC, please avoid answers like "use Attunity".
We use MS SQL Server 2016 Enterprise edition, Oracle 12.2.
I finally made it working, hope it helps someone.
I created a new DSN
as User ID I put [OracleUserName]
beware the square brackets! Those are necessary
the OracleUserName is user name configured on Oracle side (I do not know much about Oracle). The DBA configured the AD account to be able to login as this user.

How to connect sql developer to Oracle database using instant client_12_1

I have downloaded the oracle instant client 12_1 but i'm unable to connect to the oracle database.when i tried using sql developer it is displaying the following error.
The Network could not be established.
I'm using windows 7 and my Oracle_home path is defautly set in the system variables as
path
E:\app\dell\product\11.2.0\dbhome\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
I suspect you've begun the headache of messing with the connection string. I seriously recommend you find the option in SQL Developer that will allow you to connect directly to the server (bypass TNSNAMES) and use EZ Connect. The connection string will look like this:
server.whatevz.com:port/sidname
I don't use SQL Developer, so I can't point to it specifically, but I have used it and configured it as such, and it works fine. I'm a fan of PL/SQL Developer (All Around Automation) myself.

oracle 11g Personal Edition: Create Schema

This is a two-part question. I have installed an Oracle 11g Personal Edition Server on a Windows Server 2008 VM. During the installation I chose the option to install a database as well (sample/blank database?).
Now, on the VM, I can launch the Oracle Enterprise Manager Console at localhost port 1158, login as either SYSMAN or SYSTEM and in that I can see: 'Database Instance': orcl.127.55.199 . I can also see 'OracleOraDb11g_home1TNSListener' in the Services control panel in running state.
1) I need to be able to create a new Schema in the default database. How do I do that using the Oracle Enterprise Manager or anything else?
2) How can connect to that schema from another computer, say a Windows 7 workstation? I am able to see the VM running the Oracle server and I am even able to make a connection but I get an error like '12541 no listener'. I am pretty sure I have the Oracle client software installed. Do I need to create a TNS file? I am using Direct Connection.
Thanks!
Never mind:
I got this all to work. Here are some brief notes:
1) Used Oracle Database Configuration Assistant (ODCA) to create a database
2) Used Oracle NET Manager to Create a Listener
3) Restarted Oracle Listener Service
4) Used Oracle Enterprise Manager in localhost environment to create Users--which seem to be the same as Schema--thanks #Leo for your input in the Comments!
Everything works now!
Hope this helps someone.

How do I connect to Oracle with SSIS? I am getting the error: "tns listener was not given the service_name in connect_data"

I am trying to connect to an Oracle DB through the Oracle Provider for OLE DB in SSIS, but am getting the following error when testing the connection: "tns listener was not given the service_name in connect_data". I am not too familiar with Oracle, so could someone provide me some direction for how to fix this error?
You can add the service name after the host name with a forward slash between them. This has worked in both the Microsoft and Oracle OLE DB providers.
IP/Service_Name also works, "12.12.123.123/Server1.domain.com"
First of all, always use Oracle driver. Not the Microsoft one.
Then, when connecting, supply the TNSNAME, USERNAME and PASSWORD to a OLEDB Connection.
That's all!
Ok ok, been here, and this is what works:
You need oracle data access components http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Download the one that applies to you (11g, 12c...)
It installs an OLE DB provider which is FAST and also .NET connectors (wich also work really well), so I recommend using OLEDB (also, attunity connector works wonders aswell after you installed ODAC).
Then just connect using ip/service name + credentials, for example
Image
You need to type "Servername/ServiceName" to Server Name Field .

Resources