Wrap SQL Server Objects Quickly? - sql-server-2008

Back in the MSSQL 2000 timeline, there was an IIS integration layer that allowed HTTP GET commands to make select statements, and there were other SqlXml niceties that worked (not that fast or well but they worked) out of the box. I gave a chance to expose database stuff fairly quickly.
What is the comparable technology for MSSQL 2008/2012? I saw slashDb (http://www.slashdb.com/) and it seems to do that, but I am trying to understand the other options out there. Just SQL Server crud and sproc access.
Thanks.

Yes, SlashDB does exactly that and more. Full disclosure: I am the founder and CEO.
Once SlashDB is installed you would use its web interface to connect it with your database. Depending which database login and database schema you use for that connection, you will have the tables and views from that schema turned into of URL endpoints.
Those URLs can be followed in the browser but they are also API endpoints in JSON, XML or CSV. It works for reading and writing (you can control that in user configuration).
In addition to that you can define a set of parameterized SQL queries. Each query is given a name and instantly becomes an API endpoint too.
In order to help you getting started easily SlashDB is available on AWS and Azure marketplaces, as a Docker container from DockerHub, pre-built virtual machines or as .rpm and .deb packages for installation directly on Linux.
For more technical info please visit: https://docs.slashdb.com

The nearest equivalent may be SOAP/HTTP endpoints, however Microsoft has deprecated them for various reasons and recommends WCF or ASP.NET instead. Although the simplest way to get a quick CRUD setup is probably to use a framework or ORM that generates it for you, like LINQ to SQL or whatever else suits your needs.

Related

Connecting re-frame app to a Database

I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
In other applications I've written, I've had to add the database specifications (username, password etc) into profiles.clj. Should I create profiles.clj and add the location of my database there? And does this mean I have to update the project.clj as well?
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs.
I apologise if these questions are trivial but after reading the documentation several times I am still a little confused
re-frame is a framework for building client-side web applications. You won't be able to do generic database queries as most databases don't support direct access from a browser.
I'm having a problem with my re-frame application. I can't figure out how to connect it to a local database on my machine.
You probably need to create a middle API tier that accepts REST requests from re-frame, and queries the database, returning JSON back to the client.
Finally, do the queries to the database, such as GET and POST requests, go in db.cljs
Those are probably queries to your API tier? They can live anywhere that you would like.
One thing to clarify: re-frame has an app-db that it uses and refers to. This is a client-side database of local state that lives in your application. It doesn't have a connection to the backend, at least not without you writing more code for it. It sounds like you might be confusing these?

How to use Oracle database as web service provider with JSON?

I'm considering an option to use Oracle Database as web services provider and implement web service logic via PL/SQL stored procedures. I used to code stored procedures some time ago, though I'm not sure what direction should I go in order to use most up to date solutions:
I would like to use amazon cloud for oracle solution. After creating oracle instance, what else should be done in order to use it for serving as web server. I didn't find Amazon Cloud for Oracle Application Server or Glassfish. Also, I need to use JSON but it's unclear does Oracle have such support out of the box. Currently, I found the only option to use Soap 1.1 with Oracle XML DB
Should there be two DB instances for security issues: one node serving as data source and the other one serving as web service provider.
Would appreciate for any ideas and info :)
You might want to review the Oracle Rest Data Services Developer Guide
Amazon provides Oracle access in their product "RDS", but I've never tried it. However, I doubt that you'd be able to use the Oracle web listener directly.
JSON support is not included in Oracle AFAIK, but it should be easy to implement on your own.

iOS and Mac OSX communicating with MySQL database

I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.
I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.
One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).
I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example

Interface between CardDav server and MySQL database

My web app uses mysql to store contact data. I'd like to sync this data via carddav with mobile devices. I understand carddav is based on a file system, not a database. What software is available to act as an interface or wrapper to make the carddav server work with mysql? or other relational database?
You might want to take a look at Bedework.
Baikal just added this feature!!!
Most dav servers are file system based. If you use SabreDav you can build a virtual filesystem based on your own backend. Baikal is a project that uses sabredav, and a virtual file system. Until recently it stored its data in sqllite. Now it supports both mysql and sqlite.
Its still not 100% mature, but its a great starting point. Playing around with it, I have been able to create contacts directly in the DB (by uploading vcard blobs to a table) and then having them show on my ipad addressbook.
After evaluating many systems, ones built on sabredav like baikal tend to be the simplest to build on. Fruxx is something else you may also check out. Its a hosted system, but will soon have an api.
Last if you are looking for a very elaborate system, then take a look at tine20. It supports activesync (illegally in the usa), carddav, caldav, and has a decent extjs web ui. It natively stores contact information in its mysql store, which is nice since you can update a contact through a sql statement without having to build a vcf file. Where tine doesnt make sense is that it uses a bit more resources because of all the features it offers, and the complexity has ensured that it has a VERY complicated database schema. In other words, you are probably better off creating a rest api on the tine source code rather than doing bare sql inserts.
http://baikal-server.com/

What are the various possibilities to use MySql in a desktop applicaion

Can MySql database be used as a back-end of a desktop application. What are the various possible ways to do it?
I would say that it would be possible, with each desktop application client connecting to a centralized mysql database, at the client site, or possibly connecting to a centralized server managed by you/your company, and like #Neil Butterworth mentioned there are various APIs/methods to use to talk to the database. However, if you are looking to embed a database with your application, I would suggest looking at sqlite instead. It is a small,lightweight relational database designed for being embedded into applications.
To add to nstehr's answer, see:
SQLite vs MySQL
How scalable is Sqlite
How do databases work internally
Yes, I have done so on more than one occasion. Build your database in MySQL, either locally or on a remote machine, and then set up your connection to the database using the appropriate API.
There is a package for connecting to a .NET application (just search .NET MySQL library and it should turn up), with Java you can use Hibernate (or any other ORM Framework) and set the dialect to whichever version of MySQL you're using in the hibernate.config file. Or you could just use ODBC/JDBC directly. I'm sure other languages have their own support.
Any application, if built well, should be able to be supported by a variety of databases, and it should not affect the application. Switching between databases should involve changing a couple of property files at most, and then testing for database-specific idiosyncrasies.
Can MySql database be used as a
back-end of a desktop application
Yes, of course - just like any other database.
What are the various possible ways to
do it?
What do you mean? Do you mean how to access the database from the app? Lots of ways - some are:
via its native C API
via ODBC
via JDBC
Which one you use will of course depend greatly on which language(s) your desktop app is written in.