Grails: Using SQL Server 2005 with Grails - grails

We have a requirement where a Grails application is required to connect to an external SQL Server 2005 (i.e. client's database server via a linked server). Our grails application will have its own SQL Server database instance for user authentication (so will mostly have only one domain class) and then it needs to connect to the external SQL Server database to fetch (only SELECT permission provided) data from 10 or 15 tables (out of 250 tables available) and show it the grails application.
I would like to know would be the best approach to take in this scenario.
Thank You.
Jay Chandran.

You can use the http://grails.org/plugin/datasources plugin and configure the external server as a read-only datasource to ensure that only reads are performed. If you don't want to map domain classes on that server you can use groovy.sql.Sql to execute SQL queries.

Related

Delphi, TAdoConnection, Azure SQL Managed Instance

I'd like to move the database for several Delphi applications from on-premise SQL Server to Azure Managed Instance. It would use Azure Active Directory Integrated authentication.
We use TADOConnections. I'm having trouble setting the connection string. It looks like TADOConnection does not support Azure Managed Instance and Azure Active Directory Integrated authentication. Is that correct?
Version 18.3 and latter of the Microsoft OLE DB Driver for SQL Server includes the required Microsoft Active Directory Authentication Library (ADAL.dll). Since this traffic is going across the internet keeping this up to date would be a good practice.
Then using the connection string shown for the database on Azure as a starting point you can add Provider=MSOLEDBSQL.1 (plus a ; separator if needed) in the ADO connection string so the above driver is used.

How do i connect to database after i installed SSIS 2012?

I am trying to connect to database from Integration Service project from Microsoft visual studio. How do I create a database from SQL SERVER 2012.
SQL Server Management Studio (SSMS) will allow you to create a database and tables through its graphical user interface. However, I'm guessing what you're looking for is actually an SSIS Connection Manager to an existing database. Look at the connection managers in SSIS, create a new one, and fill in the boxes. What you're doing is building a database connection string. You will need credentials (username and password, or a Windows authenticated user) to connect to the database. Also, you may need to spend some time reading the documentation.

Store UmbracoIdentity data in SQL Server

I have implemented Umbraco using UmbracoIdentity for membership and everything was going fine until I deployed my solution to an Azure Web App. On azure I am getting permission errors because UmbracoIdentity is using a SQL Server CE database stored in the App_Data folder.
For reference the error I am getting is:
Exception type: SqlCeException
There is a file sharing violation. A different process might be using the file. [ ...\wwwroot\App_Data\UmbracoIdentity.sdf ]
My Umbraco data is being stored in an SQL database and I would like to store my UmbracoIdentity membership data here as well. I would appreciate any help in how to setup SQL Server as the user store for membership data.
You need to implement the IExternalLoginStore.cs interface and then configure the application to use it. It should be fairly simple to implement as you can use the SQL Server CE implementation as an example. I've done one for Azure Table Storage - you can check the Readme at https://github.com/alindgren/UmbracoIdentity.AzureLoginStore to get an idea of how to configure the app to use a custom external login store (which for me was the least obvious part).

How to hide SQL Server database structure

I need to deliver ASP.NET MVC application to client. It uses a SQL Server database.
Is there any way that I hide the database structure from users? They will be admins on server and do installation.
Thanks

Trying to connect ASP.NET MVC to SQL Server 2008 R2 with possible wrong connection string

Running SQL Server 2008 R2 and ASP.NET MVC 2 web application on the Virtual Server of big german hosting-provider.
I have a problem to connect to the SQL Server.
On localhost this connection string works fine:
#"Data Source=LOCAL-HP;Initial Catalog=OnlineVertrag;Integrated Security=True";
I'm using a similar connection string on the server:
#"Data Source=MYSERVER\SQLEXPRESS;Initial Catalog=OnlineVertrag;Integrated Security=True";
but nothing happens over there.
Here is my project which I am trying to connect: http://www.hotcont.eu/OnlineVertrag/Home
Based on your comments, your SQL instance on the server has a username/password combination. You cannot use the integrated security connection for a SQL Server connection requiring SQL authentication.
Using the login information provided to you by your host, you should update your connection string to the following:
Server=MYSERVER\SQLEXPRESS;Database=OnlineVertrag;User Id=myUsername;
Password=myPassword;
Taken from ConnectionStrings.com
EDIT
Ok - I think I know what you are dealing with now. You have a virutal machine hosted on a large hosting provider -> meaning that you have control over the machine itself (aka Remote Desktop Management or something?)
The SQL connection string that I provided is for use with SQL server accounts -> meaning those that you actually create within SQL server itself. The SQL connection string that you provided uses the current logged in user's user account information from Windows to connect to SQL.
So here is the disconnection between localhost and the virtual server. When you are running on localhost, I am going to assume that you are using the built in web server to Visual Studio or some equivalent. Most often, during debugging, the web application is running under the Logged in user of the machine - aka: you. You have permission to your own SQL database, thus no issue. BUT...when you deploy your web application to an IIS instance, the web application is no longer running as the logged in user, but rather the identity of the application pool that is your app is a member of. Typically this is something like NETWORKSERVICE.
You have three options available to you
Enable and use SQL user accounts for connection from your web application and your SQL server. If you choose to go this route, you will need to use the connection string I provided above.
Login to your SQL server and add the identity of your application pool to the Allowed Users of SQL server and your database.
Change your application pool's identity to an actual user account on the server (BAD IDEA)
Most web applications go with the first option as it allows you do a few things such as create a distinct SQL user for each application that you host and as well as you can explicitly define permissions for the SQL user to each database that it may need access to (for instance, do not allow the SQL user to DROP tables).
EDIT 2
The way you are trying to connect sounds like it should be using the Shared Memory Protocol, but it might be trying to connect over TCP/IP. I forgot this earlier, but most installs of SQL are not setup to listen on the TCP/IP interface on first install. To check your configuration, click the start button (or orb or whatever Microsoft calls that now) -> All Programs -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager. This will open a new window with some options on the left hand side. Click the SQL Server Network Configuration. Ensure that TCP/IP and Shared Memory is set to enabled. If a 64 bit install, you should probably do this for both the SQL Server Network Configuration (32 bit) and the SQL Server Network Configuration
http://msdn.microsoft.com/en-us/library/ms191294.aspx
Try this
Data Source=MYSERVER\SQLEXPRESS;Initial Catalog=OnlineVertrag;Provider=SQLNCLI10;Integrated Security=SSPI;Auto Translate=False
I hope this works for you.

Resources