SSAS on SQL Server Docker Linux Container With Java Application - java

I have start SQL Server Docker Container and i have Java as backend application which communicate with database.
I can do all the JDBC call without any issue.
Now i need to use SSAS to display data in Pivot Table in frontend. I am not sure if this is possible or not. Because most of tutorial says i need IIS server, which is windows specific application, the SQL Server is image on top of Linux OS image.
I got this blog which talks about connecting Java to SSAS (But it require IIS). Since container OS is Linux, and IIS can't work with Linux.
This URL Microsoft says SSAS feature is part of SQL Server 2017 release.
Any Idea if this is possible or not?
Can i use SASS with IIS?
http://www.olap4j.org/ is for JAVA but it required IIS.

SQL Server for Linux doesn't include SSAS, it's only available on the windows version.

Related

H2 Database Auto Server mode : Accessing through web console remotely

I am fairly new to H2 Database. As a part of a PoC, I am using H2 database(version : 1.4.187) for mocking the MS SQL Server DB. I have one application, say app1 which generates the data and save into H2. Another application, app2, needs to read from the H2 database and process the data it reads. I am trying to use Auto Server mode so that even if one of the application is down, other one is able to read/write to/from the database.
After reading multiple examples, i found how to build the h2 url and shown as below:
jdbc:h2:~/datafactory;MODE=MSSQLServer;AUTO_SERVER=TRUE;
Enabled the tcp and remote access as Below:
org.h2.tools.Server.createTcpServer("-tcpAllowOthers","-webAllowOthers").start()
With this, I am able to write to the database. Now, I want to read the data using the h2-web-console application. I am able to do that from my local machine. However, I am not able to understand how I can connect to this database remotely from another machine.
My plant is to run these two apps in an ubuntu machine and I can monitor the data using the web console from my machine. Is it not possible with this approach?
How can I solve this ?
Or do I need to use server mode and explicitly start the h2 server? Any help would be appreciated.
By default, remote connections are disabled for H2 database for protection. To enable remote access to the TCP server, you need to start the TCP server using the option -tcpAllowOthers or the other flags -webAllowOthers, -pgAllowOthers
.
To start both the Web Console server (the H2 Console tool) and the TCP server with remote connections enabled, you will have to use something like below
java -jar /path/to/h2.jar -web -webAllowOthers -tcp -tcpAllowOthers -browser
More information can be found in the docs here and console settings can be configured from here
Not entirely sure but looking at the documentation and other questions answered previously regarding the same topic the url should be something like this:
jdbc:h2:tcp://<host>:<port>/~/datafactory;MODE=MSSQLServer;AUTO_SERVER=TRUE;
It seems that the host may not be localhost and the database may not be in memory
Is there a need for the H2 web console?
You can use a different SQL tool using the TCP server you have already started. I use SQuirreL SQL Client (http://squirrel-sql.sourceforge.net/) to connect to different databases.
If you need a web interface you could use Adminer (https://www.adminer.org/) which can connect to different database vendors, including MS SQL, which happens to be mode you're running H2. There is an Adminer Debian package that should work for Ubuntu.

Is it possible to connect a Java web app to SQL Server in Virtualbox?

I have a Mac running OS X 10.9 with Java 1.7 using Eclipse Luna. I also have MySQL and MySQL Workbench. However, my programming subject only teaches JDBC using SQL Server. I don't mind learning how to use JDBC with MySQL as the DBMS. But I was wondering if I can connect my app to a virtual machine running Windows 7 with SQL Server 2008 on Virtualbox?
TL;DR:
Java web app (Mac) <---connect---> SQL Server (Virtualbox Windows 7), possible?
Of curse you can.
You will have to configure some port forwarding from your VirtualBox and maybe Windows itself.

Can a Java application running on a Window's Server connect to SQL Server via Windows Authentication

Let me give some background before I ask my question. I’m at a shop that primarily runs Windows. We have several batch applications running on Windows Servers (mostly 2003). Most of these batch applications are written in C# and C++; however we have a handful of applications that are written in Java.
The batch Java applications are connecting to a SQL Server 2005 database using JDBC. Please note we are not using an application server.
Currently we store database connection information (database, username, & password) in the Windows Registry.
Unfortunately these really unfriendly auditors (bad attempt at humor) are not happy with us over the decision to store database connection information in the Windows registry.
We are now updating our batch applications to connect to SQL Server using Windows Authentatication.
Using Windows Authentatication for C# and C++ applications is not a problem; however I’m stuck on the direction to take for the Java applications.
Can anyone advise if it is possible to use Windows Authentatication to connect to a SQL Server 2005 database from a Java batch application running on a Windows server? Again we are not using an application server.
If this is possible what are your recommended approaches?
I have a strategy to simply encrypt the password which will make the auditors happy, however I would prefer to have all of my batch applications connect to SQL Server via Windows Authentatication.
You can connect to SQL Server from Java programs using windows authentication as follows:
Create a windows account for the application that would be used to run your programs. This account's credentials will be used to connect to the server.
Get Microsoft JDBC Driver for SQL Server from here.
Configure the JDBC URL as follows:
jdbc:sqlserver://<hostname>;databaseName=<DBName>;integratedSecurity=true
Configure the launcher that run the Java programs from command line to include the following JVM parameter:
-Djava.library.path="<jdbc driver dll location>"
where the location is the directory where the JDBC driver downloaded earlier is installed or extracted. It was C:\Program Files\sqljdbc_4.0.2206.100_enu\sqljdbc_4.0\enu\auth\x64 in my case. As Luke Woodward mentioned in the comments, the dll should be picked based on the JVM used for running these programs.
With the above configuration, the connection established to SQL Server would use the Windows Authentication Credentials of the domain user running the java program/process.
The first step is to setup ODBC, you can go to Control panel -> Administrative tools -> ODBC. Add a new DSN to connect MS SQL Server using windows authentication account following wizard setup.
The second step is the same as using SQL Server authentication account. But the only change is that the connection string is changed to: jdbc:odbc:dsn-name. There is no need to use username/password anymore, because it is already connected to the server.

Strange performance Issue with SQL Server + Spring JAVA application

I am experience a strange performance issue when accessing data from SQL Server from a Spring based application. In my current setup, the Spring java application runs on a separate machine accessing data from a remote SQL Server DB. I am using NamedParameterTemplate in Spring, which I believe uses Prepared Statement to execute the query. For some reason, some of the query takes a long time to complete (approx. 2 mins). The JAVA app runs on a 64bit machine running 64bit version of Java v1.6, and the SQL Server is MS SQL Server 2008 R2.
The strangeness, is if I run the same java app from my laptop running Windows XP 32bit, running the same version of Java v1.6, the query takes less than a second, accessing the exact same remote DB server (infact, I am connected through VPN)
This shows the issue is not with the Spring framework but may be with the SQL JDBC Driver. I am using Microsoft JDBC Driver 4.0 for SQL Server (sqljdbc.jar)
I am completely clueless, as what could possibly be wrong and not sure where to start my debugging process.
I understand, there isn't much information in my question, so please let me know if you need any specific detail.
Thanks for any help/suggestions.
I think this may be due to the combination of your java version and jdbc driver failing to handshake the connection with the server. See Driver.getConnection hangs using SQLServer driver and Java 1.6.0_29 and http://blogs.msdn.com/b/jdbcteam/archive/2012/01/19/patch-available-for-sql-server-and-java-6-update-30.aspx
If so, switching to 1.6.0 upgrade 30 or higher and applying kb 2653857 ought to fix it.

Connect from Oracle server to MS SQL Server in Java

I have a Java application that is connecting to a MS SQL Server database using the Microsoft JDBC Driver 3.0 for SQL Server (sqljdbc.jar). The Java version this is being compiled to is 1.5.0_12. It is working fine from my local Windows machine, but it is causing all kinds of errors when I try to run it from the Oracle server. Any advice as to how to make that successful connection?
** Withdrawn... Sorry, didn't see the Application Server portion in the initial question

Categories