LocalDB support in Windows
Can we connect to LocalDB with either the Microsoft JDBC or JTDS plugins?
Most of the information I've found says "no," especially for Microsoft's plugin. JTDS seemed like it would work, but I have been unable to get that working.
http://stackoverflow.com/questions/11345746/connecting-to-sql-server-localdb-using-jdbc
A patch for JTDS was created in Novermber of 2013: http://sourceforge.net/p/jtds/bugs/716/.
Any other suggestions or ideas?
Please sign in to leave a comment.
Looks like this has been resolved in jTDS' Git repository.
Patch: http://sourceforge.net/p/jtds/bugs/716/
Change: https://github.com/milesibastos/jTDS/commit/85c0c4050322e090231777500134b7798d7e2d23
Thank you, I've added this information to http://youtrack.jetbrains.com/issue/DBE-103 for developers to consider.
Regards,
Alexander.
What is the current workaround to connect with localdb? I followed through the different links but was not able to make this work. I'm relatively unfamiliar with jdbc.
TIA - Jeff Odell
Hi,
Here are the steps I took.
1) Clone the git repository and build it with JDK 6.
2) Get your LocalDB instance. I use the Nuget Package Manager console in VS 2013 to do this.
3) Create the following Database Source Driver.
4) Create the following Database Source,
When I test the connection, I get this error. I think it's unrelated, and I just have to install whatever the SSPI library is.
To continue, I copied the 32 bit ntlmauth.dll from the jTDS build to the 0xDBE bin directories and restarted the IDE.
./lib/x86/SSO/ntlmauth.dll
C:\Program Files (x86)\JetBrains\0xDBE 138.1400.3\bin
C:\Program Files (x86)\JetBrains\0xDBE 138.1400.3\jre\jre\bin
This allowed me to connect and get a password prompt. Now I just need to figure out what my LocalDB password is ...
I added an additional user to the LocalDB.
Then, I granted privileges. I was having trouble granting privileges via command line, so I cheated and used SQL Server Management Studio.
You *should* be able to do this with `GRANT EXECUTE TO testuser`, but I wasn't able to log in with "testuser" this way.
Right click on the database, and then "Properties." This will bring up the first window, and then click on "View server permissions."
Finally, you'll see this when testing the connection.
By the way, both sqlcmd.exe and 0xDBE seem to have issues using databases with hyphens in their name.
Notice the lack of a tree arrow to see the tables and other objects.
I was able to connect DataGrip to a LocalDb install. I documented everything here: https://youtrack.jetbrains.com/issue/DBE-103
I hope this helps someone else.
- Justin
Thank you, Justin!