Jetbrains Datagrip cannot connect sql server without specify database - datagrip

i try to use Datagrip as my primary sql server query tools, bit i meet a problem that i can not move forward.
When i setup the project data source, i have to choose a Database, otherwise it will goto the default tempdb, how i can work like sql server management studio, that i can see all database list.
i have tried both jTds and Microsoft drivers, both not works.
or can i choose multi-database? i do not want to create one data source for one database.
if i connect to mysql, it works like expected.
tks

It is possible to connect without specifying the database. Just leave this field blank. After entering other settings (host, port, user, password), go to Schemas tab in Data Source properties and select all the Databases and schemas you want to work with. Then invoke Synchronize action for this Data Source in Database tool window.

DataGrip 2016.2 EAP claims to have support for showing multiple databases. See https://blog.jetbrains.com/datagrip/ and find for "Database View". Unfortunately, as of the date I'm writing this, it doesn't seem to work at all.
Unfortunately, Andrey's suggestion did not work for me.

Related

Visual Studio 2015 Web Test with Data from Oracle Database

I'm writing a webtest in Visual Studio 2015. The webtest I currently have allows me to run a static test.
I would like to spice things up and therefore add more realistic data. The data I want to use is stored in an Oracle Database 12c.
So I'm trying to add a new Data Source to the webtest. I enter the TNSName, Username and Password for which I would like to connect and test the connection. The connection can be established, but the list with tables I can choose from is empty.
Connecting to the same Database using the "Server Explorer" in Visual Studio 2015 works. And using this method I do get the full list of Tables contained in that Database. I can even query any of the tables.
So how can I fix my webtest to have access to a specific database table (row)?
If you can connect to the DB but you don't see the needed tables it should be a permission issue.
Do you use same credentials from "VS->Server Explorer" to connect to the DB?
If this is not the case, do you have more than one Oracle clients installed in your system? If yes, then most probably, the DataSource control uses the wrong client and the "Server Explorer" the correct one.
Are you using synonyms as proxies for your tables (e.g. for permission reasons)? synonyms will not show up when querying the list of tables that the user can access. They need be queried separately. When only the available tables are queried but not the vendor specific aliases this might lead to an empty list.
You need to install ODAC for Visual Studio 2015 to view the database tables. Here is the link for it.
http://www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownload-2745497.html

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.

Defining a Redshift connection in DataGrip

I'm trying to define a Redshift connection in DataGrip but couldn't find any Redshift driver in the UI. I tried using both Postgres and generic Database Driver with no luck.
Has someone been able to configure this?
If you want to connect DataGrip to Redshift I suggest you use the jdbc drivers from AWS. Just download them to a directory where you can keep them.
Then you open DataGrip and go to the data sources menu (⌘;).
Right-Click on one of the pre-installed drivers or somewhere in the driver section. And select 'Add → Driver'
Give it a good name like 'Redshift' and in the bottom part, click on the + Symbol under Driver files, select the driver you just downloaded and click OK.
Under class, select com.amazon.redshift.jdbc41.Driver, under Dialect, select PostgreSQL.
Now you can go to the data sources menu (⌘;) and click on the "+" symbol in the top left corner and select the Driver you just created (in my case it's called "Redshift") as the data source type.
Now copy your redshift jdbc url (you can find it in your cluster configuration under "Cluster Database Properties") into the URL field and fill the user and password fields with your credentials.
Now can you click on "Test Connection" and it should work.
I hope this helps. If you have further questions or problems to follow the instructions, feel free to comment.
DataGrip added the native support for Amazon Redshift. So now it became a lot easier.
I succeed after all with Postgres driver (I had to add SSH tunnel - not relevant for this problem

Linq DataContext.CreateDatabase on Azure

This came up once before: Use DataContext.CreateDatabase in SQL Azure
The answer accepted was "maybe it's not possible". Didn't seem like a full answer.
I have a set of classes fully defined and I am wanting to create a database on Azure for this. It's not working because the USE statement does not work: http://msdn.microsoft.com/en-us/library/azure/ee336288.aspx
So, the database gets created as blank, and internally Linq generates a USE statement to move to that database and start adding tables. This fails and it throws an exception.
So how can I create my database? Can I use Linq to add tables to an existing database? Can I enable USE on Azure somehow? Seems ridiculous this does not work.
After messing around for a while on this, I ended up creating the database against a local SQL Server instance. Then used SQL Server Management Studio -> Tasks -> Script Database, and turned on the export type to be Microsoft Azure. Then I had the script file needed to run on the Azure server. I'll leave the question open for a day or two because I am curious if this can work with Azure directly somehow. If I don't hear anything, I will close it.
The USE statement does not switch between databases in Azure SQL Database. You will have to connect to the database to create a table on that database.
Regards
Dhruv

How do I connect to my local SQL instance in Visual Studio?

I've installed VS2010 Express and all associated SQL. I've got an instance running on my local machines of .\sqlexpress and I can connect to it with SSMS. I've created some tables etc.
I want to use Linq to SQL so I have created a new empty .dbml file in my solution. I assume the next step is to connect to the database, but I don't know how as I've never done this before.
I tried Add Connection as it suggests, and the Data Source I can choose Access Database, SQL Server Compact 3.5 or SQL Server Database File.
The Database File one says, "use it to connect to a local instance", so I click that. Then it asks for a database file name, new or existing. Surely I should be typing in the instance name not doing this file thing? If I do type something in, it crease a .mdf in my documents folder and it doesn't really help me much.
Any ideas how I can get this to work?
it's easier than you think.
you create a new database in SQL Management Studio, you call it
whatever, myDatabase...
from Visual Studio you select the SQL Provider and you select the
local instance and the myDatabase as db name.
everything is basically as you said except that you should have created a database and you should then select it in VS.
doing this from a new EF model, VS will store the connection string compatible with EF format in the app.config so you will be able to check it and see how such connection string is written.
I finally figured this out via a blog post or two somewhere online. With the express edition, the option to connect to a local database in the normal way via IP or ./sqlexpress is not present. You have to connect using a File, by finding the .mdf file on your hard disk (within the SQL server folder somewhere) that represents your database, and selecting it.
I have no idea what happens if you update your database schema in SSMS, or why they've restricted it to this bizarre method, but it works and I have been able to query my database.

Resources