SQL Server (v2016) – Installation – Blocked – “Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase”


In the process of installing “SQL Server 2016” for a new client.

As it is a new client and not really sure exact features they will be using, chose to install “All features“.

Install Blocked

Installation is blocked with the error pasted below:


Feature Rules



Oracle JRE 7 Update 51 (64-bit) or higher is required for Polybase.

Rule Check Result



This computer does not have the Oracle Java SE Runtime Environment Version 7 Update 51 (64-bit) or higher installed.  The Oracle Java SE runtime environment is software provided by a third-party software.

To continue, download the Oracle SE Java Runtime Environment from http://go.microsoft.com/fwlink/?LinkId=526030.




Visited Microsoft URL

Visited the listed Microsoft page and directed right away to Oracle’s Java download page.


Java Standard Edition Downloads

Here are the downloads available for java Standard Edition ( Java SE)



  1. JDK
    • We know we need JRE ( Java Runtime Engine), and not JDK ( Java Development Kit )
  2. Server JRE
    • Thought we could get away with the the lighter footprint Server JRE
  3. JRE
    • JRE


Server JRE

Server JRE – Downloads

Chose Windows x64.

Install Package Contents

The installer is bundled as a tar.gz.

Using 7-Zip extracted the file, but no installer.

Just app executable and class files.

Need more than that to install JRE and have SQL recognize that Java JRE is installed.



Java SE Runtime Environment 8 Downloads

Needed an executable offline installer and our bitness is 64 bit and so chose jre-8u131-windows-x64.exe.



Actual Installation is straightforward.




Destination Folder

Create destination Folder beforehand.

Here is a sample script.

@echo off
rem _folder=C:\Program Files\java\jre1.8.0_131
set "_folder=E:\ProgramFiles\Java\JRE1.8.0_131"

if not exist %_folder% mkdir %_folder%




Destination Folder ( Changed )


Java Setup – Progress


Java Setup – Complete


If you will be evaluating \ using Polybase as part of SQL Server v2016, please download and install Oracle JRE ( Java Runtime engine) beforehand.

For JRE, there are two packages available for download.  One is marked Server and the generic one.

Please choose the generic, full version.

Apache / Tomcat – PostgreSQL – Sample Database Query



A few weeks ago I covered a little Java/JDBC-JSTL Application.  The app read data out of a Microsoft SQL Server DB.  The application sat on a Apache Tomcat which is an Opensource Web Server and Servlet Container.

Here is similar version that reads data from a PostgreSQL Database.

There are many similarities between the original Application and this one and I will forsake cut/paste tendencies and omit much here.

Additionally, in truth this was a much quicker implementation.

The URL for the MS SQL Server implementation  is https://danieladeniji.wordpress.com/2014/04/24/technical-apache-tomcat-microsoft-sql-server-sample-database-query/ .


PostgreSQL JDBC Driver

Download Location

As of May 17th, 2014, the latest PostgreSQL is version 9.3.  It is available @ http://jdbc.postgresql.org/download.html




There are 3 versions of the JDBC Available.

JVM Version JDBC Version Driver Version
v 1.7, v 1.8 JDBC41 Postgresql Driver, Version 9.3-1101
v 1.6 JDBC4 Postgresql Driver, Version 9.3-1101
 v 1.5 JDBC3 Postgresql Driver, Version 9.3-1101


Depending on our JVM, we will download one of the above.

What is your JVM?


java -version


java --version




As we JVM 1.8, we will down the JDBC41.jar

The exact URL is http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar



wget "http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar" -O "/tmp/postgresql-9.3-1101.jdbc41.jar"





Where is $CATALINA_HOME/lib

We know we need to place the jar file in $CATALINA_HOME/lib… What and Where is that?

We installed Apache Tomcat version 6 using yum, and our install location is /usr/share/tomcat6.

Underneath /usr/share/tomcat there is a lib folder; which is actually a symbolic link to /usr/share/java/tomcat6.


Confirm $CATALINA_HOME/lib Folder Contents

Let us see if there are other jdbc jar files in that location…


ls /usr/share/tomcat6/lib/*jdbc*.jar





Copy JDBC Jar files into $CATALINA_HOME/lib

We need to copy postgresql-*jdbc.jar unto the lib folder.


sudo cp <jar-files> <tomcat>/lib


sudo cp /tmp/postgresql-9.3-1101.jdbc41.jar /usr/share/tomcat6/lib


Confirm JDBC file copied


ls <tomcat>/lib/*jdbc*


ls /usr/share/tomcat6/lib/post*jdbc*.jar






Download Location

Download javax.servlet.jsp.jstl-1.2.1.jar from http://search.maven.org/#browse|-1002239620

Code – WAR File

File Contents

Here are the regular files that we will be including in our Jar file:

  • WEB-INF/web.xml
  • WEB-INF/lib
  • WEB-INF/classes
  • META-INF/context.xml
  • html files
  • image files
  • jsp files
  • 3rd Party Jar files – jstl files


Here are the files that we will not be including:

  • Notice that you do not to indicate the manifest file, as that file is auto created


WAR File – Folder Structure


Folder Folder/Sub-file What? Sample
WEB-INF Web Information
web.xml Web Configuration File
 lib Jar files 3rd party and application jar files (jstl*.jar)
 classes Compiled java files
META-INF Meta Information about the Jar file



Source Code Location

On our system, we will place our source files in /home/dadeniji/development/apache.org/tomcat/NBADraft


Create empty file structure

Create empty file structure

if [[!-e WEB-INF ]]; then
   sudo mkdir -p WEB-INF

if [[!-e WEB-INF/lib ]]; then
   sudo mkdir -p WEB-INF/lib

if [[!-e WEB-INF/classes ]]; then
   sudo mkdir -p WEB-INF/classes

if [[!-e META-INF ]]; then
   sudo mkdir -p META-INF




Create WEB-INF/web.xml

Here is the contents of our web xml file:

<?xml version="1.0" encoding="ISO-8859-1"?>

   schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

        <description>DB  Connection</description>



There are a couple of areas to note:

  • Our app version is targeting Servlet/JSP API version 2.5
  • For our DB, we are defining a resource self-named DBSport and its type is javax.sql.DataSource




Create META-INF/context.xml

<?xml version="1.0" encoding="UTF-8"?>




There are a couple of areas to note:

  • We are further defining our database resource, DBsport
  • Its type is javax.sql.DataSource
  • The username & password that is predefined on the DB are noted
  • The Driver Class Name for MS SQL Server JDBC 4.0 is indicated as org.postgresql.Driver
  • The Url is “jdbc:postgresql://DBPostgreSQL:5432/DBSport
  • For the Connection factor we are hard-coding org.apache.commons.dbcp.BasicDataSourceFactory
  • And, logging validation errors via set setting logValidationErrors to true


Copy jstl jar files into WEB-INF lib

Here are the steps to copy the jstl files under WEB-INF/lib:


if [[ !-e WEB-INF/lib ]]; then
   sudo mkdir -p WEB-INF/lib

sudo cp --update /tmp/jstl/javax.servlet.jsp.jstl-1.2.1.jar  WEB-INF/lib

sudo cp --update /tmp/jstl/javax.servlet.jsp.jstl-api-1.2.1.jar  WEB-INF/lib

Source Code :- jspSimple.jsp

Here is a sample source code that connects to the hard coded sql server and relies on JDBC APIs to query and return the recordset from a table.


	<%@ page import="java.sql.*" %>
             String CLASSNAME_DB = "org.postgresql.Driver"; 

	     String connectionUrl = "jdbc:postgresql://DBPostgreSQL:5432/DBSport?user=dbuser&password=dbpassword";

             String strSQLStatement =
                    "select * from \"public\".\"NBADraft\"  limit 100  ";
       Connection con = null;
       Statement statement = null;
       ResultSet resultset = null;

       con = DriverManager.getConnection(connectionUrl); 

       statement = con.createStatement() ; 

       resultset = statement.executeQuery(strSQLStatement);

  <th><b>Year </b></th>
  <td><b>School</b> </th>
  <td><b>Position</b> </th>
  <td><b>Age</b> </th>
  <td><b>Age</b> </th>
  <td><b>Weight (lbs)</b> </th>


   while (resultset.next())

    <td><%= resultset.getString("Athlete") %></td> 
    <td><%= resultset.getString("draftYear") %></td> 
    <td><%= resultset.getString("school") %></td>
    <td><%= resultset.getString("position") %></td>
    <td><%= resultset.getString("age") %></td>
    <td><%= resultset.getString("vitalsHeight") %></td>
    <td><%= resultset.getString("vitalsWeight") %></td>





Source Code :- explicit.jsp

The code below relies on the Context (part of javax.naming.*) and DataSource (part of javax.sql*).

Obviously, javax.naming.Context allows us to hide the server name and authentication credentials in xml files outside of the Source Code.


<%@   page   contentType="text/html;charset=UTF-8" %>   
<%@   page   import="java.sql.*" %> 
<%@   page   import="javax.sql.*" %> 
<%@   page   import="javax.naming.*" %> 
<TITLE>JSP example</TITLE>
  <h1>Hello,test JNDI !  </h1>
    Context ctx = new InitialContext();  

    Context envctx =  (Context) ctx.lookup("java:comp/env"); 
    DataSource ds =  (DataSource) envctx.lookup("DBSport");  

    //DataSource ds = (DataSource) ctx.lookup("DBSport");

    Connection  conn=ds.getConnection();   
    Statement  st=conn.createStatement();
    String    sql="select * from \"NBADraft\"    ";  
    ResultSet    rs=st.executeQuery(sql); 
    while(rs.next())   {
       Athlete:<%=rs.getString(1) %>  
       DraftYear:<%=rs.getString(2) %> 
       School:<%=rs.getString(3) %>
       Position:<%=rs.getString(4) %>
       Age:<%=rs.getString(5) %>
       Height:<%=rs.getString(6) %>
       Weight:<%=rs.getString(7) %>


Source Code :- queryDB.jsp

The code below uses JSTL tags.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

<sql:query var="rs"

   select * from "NBADraft"

    <title>DB Test</title>



     <table border="1" align="center" valign="center">

       <c:forEach var="rs" items="${rs.rows}">

	    <td><c:out value="${rs.Athlete}"/>&nbsp;</td>
	    <td><c:out value="${rs.draftYear}"/>&nbsp;</td>
	    <td><c:out value="${rs.school}"/>&nbsp;</td>
	    <td><c:out value="${rs.position}"/>&nbsp;</td>
	    <td><c:out value="${rs.age}"/>&nbsp;</td>
	    <td><c:out value="${rs.vitalsHeight}"/>&nbsp;</td>
	    <td><c:out value="${rs.vitalsWeight}"/>&nbsp;</td>





Create Jar file

Here are the steps to create a jar file


jar cvf <war-file> *.jsp *.html images WEB-INF META-INF



jar cvf NBADraft.war *.jsp *.html images WEB-INF META-INF


View Jar file Contents

View Jar file contents


jar tf <jar-file>


jar tf NBADraft.war


jar list



Deploy – Manual

Manually deploy jar file by copying the war file into your webapps folder

There is a very noteworthy coverage of manually deploying WAR file available @


#un-deploy war
if [[ -f "/usr/share/tomcat6/webapps/NBADraft.war" ]]; then

echo "Removing file /usr/share/tomcat6/webapps/NBADraft.war ."

  sudo rm "/usr/share/tomcat6/webapps/NBADraft.war"

   echo "Removed file /usr/share/tomcat6/webapps/NBADraft.war"


#deploy war
echo "Deploying file /usr/share/tomcat6/webapps/NBADraft.war.."

 sudo cp NBADraft.war /usr/share/tomcat6/webapps/NBADraft.war

echo "Deployed file /usr/share/tomcat6/webapps/NBADraft.war"

Deploy – Verification – CATALINA_HOME/conf/Catalina/localhost/<APP-NAME>.XML

Review CATALINA_HOME/conf/Catalina/localhost and look for a configuration file (XML) bearing your Application Name.

In our case, our folder’s name is /usr/share/tomcat/conf/Catalina/localhost



And, the file we are looking for is NBADraft.xml

File Contents:




Diagnostic Steps

Use lsof

Use lsof to determine where tomcat jdbc jar files are being loaded from:


sudo lsof | grep -i "tomcat" | grep -i "jdbc"





Run-Time Error Messages

javax.servlet.servletException : java.lang.ClassNotFoundException: org.postgresql.Driver

The exact error message is:

javax.servlet.ServletException: java.lang.ClassNotFoundException: org.postgresql.Driver



Check loaded jdbc jar files
sudo lsof | grep -i "jdbc"





  • Noticed that tomcat has the Microsoft’s sqljdbc4 loaded, but our postgresQL jdbc driver is not loaded
  • Remembered that I have yet to restart tomcat since I copied the PostgreSQL file to our tomcat folder
  • Let us go restart tomcat ( sudo service tomcat6 restart ) and recheck lsof


Here is the output:




  • Along with sqljdbc4.jar, we know have /usr/share/java/tomcat6/postgresql-9.3-101.jdbc41.jr


javax.servlet.servletException : org.postgresql.util.PSQLException: FATAL : no_pg_hba.conf entry for host <hostname>, user <ApplicationName>, database “<database-name;user=<username>;password=<password>”,SSL of

The exact error message is:

javax.servlet.ServletException: org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "", user "tomcat", database "DBSport;user=nbadraft;password=s1eeper", SSL of


Changed Connection URL to






Source Control





References – JSTL – Blog

References – JSTL – Tutorial


References – JSTL – Jar Files Repository

References – PostgreSQL


References – Linux – vi


Technical: Sun\Oracle – Installing and Configuring Java in Preparation of Hadoop Install on CentOS (v6.5)



Technical: Sun\Oracle – Installing and Configuring Java in Preparation of Hadoop Install on CentOS (v6.5)


Preparing to revisit install of Apache’s Hadoop install and configuration on our CentOS machines.

I know that we need Sun/Oracle’s branded Java, but that the bundled Java is the OpenJDK version.

Let us go fix that.


Get Java Vendor & Version

That is, let us determine our installed Java Vendor and Version Number.

Help is going to come from:

What is the Value of Java_HOME for Cent OS



update-alternatives --display <app-name>



update-alternatives --display java | egrep "link | priority"





Our output reads “link currently points to /usr/lib/jvm/jre-1.7.0-openjdk/bin/java” and so it appears that we are using OpenJDK.

We know Apache will rather have us use Sun\Oracle JDK.  And, so let us go get that.

Listing of Oracle JDK version 8 (JDK 1.8)

Using a web browser, journeyed to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and here is what we see.




Download JDK v8  (JDK 1.8 – Linux x86 – RPM)

Though we can download through GUI\web browser, we have chosen to download via wget.




wget --no-check-certificate --no-cookies  --header "Cookie: oraclelicense=accept-securebackup-cookie" <url> -O <file>




wget --no-check-certificate --no-cookies  --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-i586.rpm" -O "/tmp/jdk-8-linux-i586.rpm"




Install Oracle / Sun Java JDK


sudo yum install -y <jdk-rpm>


sudo yum install -y /tmp/jdk-8-linux-i586.rpm


Review Installed RPMS (Java)

Let us query rpm and make sure that our new JDK rpm is installed.


rpm -qa 



rpm -qa | grep jdk







rpm --qa -- grep jdk


Uninstall OpenJDK RPMs


sudo rpm -e <package>




sudo rpm -e java-1.6.0-openjdk-



To uninstall java-1.6.0-openjdk-

sudo rpm -e java-1.6.0-openjdk-


To uninstall java-1.7.0-openjdk-

sudo rpm -e rpm -e java-1.7.0-openjdk-

but, we get


error: Failed dependencies:
libjawt.so(SUNWprivate_1.1) is needed by (installed) libreoffice-core-1:




with the strong confirmation that LibreOffice is using open JDK 1.7, we are going to have to live with it.

Installed Files – Java

List installed locations and files for Sun\Oracle Java


Folder Binary




Alternatives – Install / Updates – Console

Alternatives can be used to manage cases where an Application is bundled by one more Vendor.  Or where a couple of versions is installed by same Vendor.

Let us register our installed Sun/Oracle java as an alternative.


alternatives --install <link> <name> <path> <priority>



## java ##
alternatives --install /usr/bin/java java /usr/java/jdk1.8.0/jre/bin/java 20000

## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.8.0/jre/bin/javaws 20000 

## Install javac only if you installed JDK (and we did)
alternatives --install /usr/bin/javac javac /usr/java/jdk1.8.0/bin/javac 20000 

##install jar only if you installed JDK (and we did)
alternatives --install /usr/bin/jar jar /usr/java/jdk1.8.0/bin/jar 20000 

Alternatives – Update


## java ##
sudo update-alternatives --set java /usr/java/jdk1.8.0/jre/bin/java
sudo update-alternatives --set javaws /usr/java/jdk1.8.0/jre/bin/javaws

## Install javac/jar only if you installed JDK package 
sudo update-alternatives --set javac /usr/java/jdk1.8.0/bin/javac
sudo update-alternatives --set jar /usr/java/jdk1.8.0/bin/jar


If you get an error message that reads:

“/usr/bin/jdk1.8.0/jre/bin/java has not been configured as an alternative for java”, then please review the earlier batch of “alternatives –install” and make sure that you have typed the correct and full path name to your binary files



Update System Path File (/etc/profile)

Using your editor of choice, Add the following to the bottom of your /etc/profile:

In our case, we will use vi and invoke as “sudo vi /etc/profile

# Update System with Sun\Oracle Java Information
# set JAVE_HOME to Sun\Oracle Install Location

# set JRE_HOME to Sun\Oracle Install location

# add User $HOME/bin and aforementioned $JAVA_HOME/bin to path



Effect System Path File (/etc/profile) Changes

Since we do not want to force a restart before we proceed, let us force execution of our /etc/profile.

sudo sh /etc/profile


Review Alternatives – Java

Update-alternatives –display


update-alternatives --display <app-name>



update-alternatives --display java | egrep "link | priority"



UpdateAlternatives -- display java


  • We see that our current alternatives pointer is directed @ /usr/java/jdk1.8.0/jre/bin/java


Update-alternatives –config



update-alternatives --config java



alternatives --config



  • Selection 2 is tagged with an *, as “Open JDK 1.7” has the highest priority ( 170051 )
  • Selection 3 is tagged with a +, as the Sun/Oracle’s  JRE Java is our current selection

Review Install Java Version

Java Version?


java -version





Javac Version?


javac -version





References – Java on CentOS


References – Java on Debian


References – Java on Ubuntu


References – Alternatives – Java


Technical: Mac OSX / Java Applet Support in Mozilla Firefox

Technical: Mac OSX / Java Applet Support in Mozilla Firefox

Here I am trying to upload files to one of our vendors, but the upload icon is not appearing in Mozilla Firefox.

I looked all over, but no plugin.

I am thinking you ‘re killing me.  And, yes where did I look?

Well in Add-On Manager; specifically the Plugins Tab.

How to get there:

  • Menu Bar – Tools \ Add-ons..
  • Tab – Plugins

Goggled for help and confirmed that I am doing what I should be doing:

How do I disable Java in my web browser?

  1. Click on the Firefox tab and then select Add-ons
  2. In the Add-ons Manager window, select Plugins
  3. Click Java (TM) Platform plugin to select it
  4. Click Disable (if the button displays Enable then Java is already disabled)

But, I am thinking no Java Plugin.

Finally got some help:

Use the Java plugin to view interactive content on websites

Installing or updating Java

And, here are the steps I took:

  • Used Browser to access http://support.apple.com/downloads/#java
  • Downloaded Apple’s version of Java (javaForOSX2013-002.dmg).  
  • On Mac,  Accessed System Preferences \ Java \ Java Control panel
  • In “Java Control Panel” \ “Security” Tab – Ensured that “Enabled Java Control content in Browser” is checked
  • Restarted Browser, but alas still no Java.

BTW, that website (http://support.apple.com/downloads/#java) is not always accessible.

So what to do, but tightened up my Google Search.

I am thinking I need some music.  There is an old school rap track that says something about “… Just your luck, Greyhound is on strike”.  Tried it, but it is a bit of a downer.  DJ Quik -Tonite is also shown on same YouTube page.  And, I knew that will help.

DJ Quik – Tonite

Went back and Googled some more.  And, found:

MozillaLine – Java

Found out a couple of things:

  • Mozilla is actively adding plugins to its BlockList


So it appears that Mozilla is heeding to all this stuff coming from the “State Department” and actively blocking even recent Java Plugins.

The MozillaLine article led me to:

Information and system requirements for installing and using Mac Java 7

So I am thinking I need the very latest java and that is available from:

Upon downloading Oracle’s java version and installing it, I am now able to use Java Applet’s (inside of Firefox).

Confirmation Steps

Apple – OSX – System Preferences – Other\Java – Java Control Panel

One can have a few different versions of Java JRE installed – You can have Oracle\Sun’s, Apples, etc.

Please make sure that the one enabled is Oracle\Sun’s 1.7._0_17

  • On OSX, access “System Preferences”
  • Access the Other sub-group, Java applet
  • Access “Java Control Panel”
  • Access the Java Tab
  • Click the “View…” button
  • Ensure that Oracle’s JRE is the only enabled option

Mozilla – Add-ons Manager

Ensure that “”Java Applet Plug-in Java 7 Update 17” is enabled.

  • Launch Mozilla
  • Menu Bar – Tools \ Add-ons..
  • Tab – Plugins

In the list of Plugins, you will see “Java Applet Plug-in Java 7 Update 17”


With BlockList and the like, it appears that Browsers are joining OS and Virus Security vendors in actively armoring their users.

For you, the user, and corporate help-desk, keep that in mind when you get support calls.

In terms of security and how it is effected, things appear to be changing all the time.

In an earlier post (https://danieladeniji.wordpress.com/2013/02/02/mac-osx-sunoracle-java-applet-typical-workspace-interaction/) on this subject, I concluded that I could not really get Java Applets to work inside Apple’s Safari Browser.  That is no longer the case, it works with the new Oracle\Sun JRE.

It might be that Apple has relaxed its security constraints on the above configuration.


Mac OS/X – Sun/Oracle – Java Applet – Typical workspace interaction

Mac OS/X – Sun/Oracle – Java Applet – Typical workspace interaction

Google Chrome

Java Applet (needs permission to run) Chrome - Java Applet (needs permission to run)

So we are asked to confirm whether we want Java to run:

  • Always run on this site
  • Run this time

We chose to have it “Run this time”.

Chrome - Java Applet (Need to download the java plug-in)

We did not get very far.  We are greeted with a warning message stating “Missing Plug-in” and prompted to download Java plug-in.

There is no need to go much further.  Java is delivered as a 64-bit plugin on 64-bit Mac OS-X.  And, Google Chrome is 32-bit.


Safari - Java Applet

Safari is stucked at the “Missing Plug-in” spot.

And, even post install of Java Plug-in, Safari is not allowing the applet to run.


Firefox - File Browse (pre plug-in acceptance)

So in Firefox, the browser asks whether it is OK to execute the “FileBrowse” plugin from Netapp; specifically upload.netapp.com

We reply yes and we are good.

Firefox - File Browse (post plugin acceptance)

We are able to click on the “Browse File” button and launch an Applet which exposes the “File Open” dialog on our screen.

So on a Mac with Java JRE installed, here is a round-up of Java JRE/Applet support:

  • Google Chrome – Stuck due to Sun/Oracle JRE being provided as a 64-bit utility and Chrome being to 32-bit
  • Apple Safari – Stuck
  • Firefox – Good

To review and get more granular insight into your Mac OS Support:

  • Launch “System Preferences”
  • In the other section, select “Java”

System Preferences

In the Java section, there are many options:

Java Control Panel - General

In the General section:

  • Access the “Network Settings” — Which allows one to choose a different proxy setting, than the one set for the browser

Java Control Panel - General - Network Settings

In the “Update” section:

Java Control Panel - Update

  • Choose whether you want Java updates to occur automatically
  • In our case, one can see we have a relative recent update.  Due to the recent proliferations of exploits you probably want it so

In the “Java” section:

Java Control Panel - JRE - Versioning (Select Version)

  • This is especially when you have two or more JREs installed, and you want to select the one you want
  • Obviously, you can also Disable all of them
  • Advanced users can also specify “Runtime parameters”

In the “Security” section:

Java Control Panel - Java Applet - Security Level

  • This is quite important as you are able to disable Java for all web browsers
  •  And, if you choose to enable it, be a bit more granular and set security level
  • Also, for security conscious configurations, choose which certificates you want exposed

In the “Advanced” section:

Java Control Panel - Advanced

So here I am thinking since the OS exposes the functionality to disable Java Plugin\applets, I am good if I choose to use the OS Functionality to do so.

I disabled it:

  • Access “System Preferences”
  • In the “System Preferences” window, “Other” section : Choose the “Java” icon
  • In “Java Control Panel” \ “Security” Tab, disable “Java” in the browsers

Java Control Panel - Security ( java disabled in browser)

So here I go return to Firefox and try to use the NetApp applet and it still works.

So I am thinking let me restart my browser and here again, I am still working.

So I am thinking those NetApp Developers are very smart and that they dutifully and gracefully degraded to HTML; as it allows file upload, as well.

But, before packing up my little project, I am thinking I should view the web Application’s source.

Wish I could say I found the “View Source” button easily, but that I had to Google for it.

How to view Source


Tools Menu -> Web Developer -> click View Page Source

It seems that the Applet is still being used and ran.  The code for Applet is present and there is no conditional statement around it:

	CODE = "org.sslupload.FileBrowseApplet.class" 
	WIDTH = 100% 
	HEIGHT = 40 
	NAME = "FileBrowse" 
	MAYSCRIPT = true>


So it seems that the Java Applet is still being ran.

So Googled again. How to disable Java in Firefox:

How to turn off Java applets

This article explains how to disable the Java plugin in Firefox so that Java applets no longer run.

By default, Firefox allows Java applets to launch automatically. However, you may decide that you do not want Java applets to run. To disable Java applets in Firefox:

On the menu bar, click on the Tools menu, and then click Add-ons. The Add-ons Manager tab will open.
In the Add-ons Manager tab, select the Plugins panel.
Click on the Java Plug-in 2 for NPAPI Browsers (Mac OS 10.6) or Java Applet Plug-in (Mac OS 10.7 and above) to select it.
Click on the Disable button (if the button says Enable, Java is already disabled).
Java applets will no longer be permitted to launch in Firefox.

Firefox - Plugins - Java Applet Plug-in

Once we clicked on the disable button on the “Java Applet Plug-in” entry, we are good:

Firefox - Plugins - Java Applet Plug-in (disabled)

the applet icon is now “X-ed” out.

So moral of the story.

  • Certain functionalities might be disabled at the OS level, but sometimes 3rd parties in this case Mozilla built a way around it.  In Firefox, they are controlling their own destiny by exposing Java JRE toolset as a plug-in






Java – JStack

Java – JStack

When reviewing \ debugging a Java Application, one can try using “JStack”.

JStack principally displays the StackTrace for each thread in an Application.

Listed below are a few well written coverage of this important tool.
1) Fun with JStack
2) How to take Thread Dumps from a JVM
3) JStack / Oracle
4) Building a JStack Profiler
5) What are good Java Profiling Tools

Couple of areas to keep in mind:

  1. On a Windows box running a 64-bit OS, you will not be able to “connect” to a 32-bit App running under WOW64.

    If you try to, you will get an error message similar to “Unable to attach to 32-bit process running under WOW64” 

Oracle \ Sun Java’s Interaction with MS SQL Server – Quick Prototype – Test out Connectivity along with Stored Procedure Invocation

Needed to review Oracle\Sun Java’s Interaction with MS SQL Server:

And so did the following:

  1. Downloaded Microsoft JDBC Driver. JDBC Version 3 is the latest out
    there and so downloaded that version.
  2. TextWrangler – Text Editor
  3. Created SQL Account on the DB Server. Granted minimum required access – SQL login Access – Specific Database Access – Permission to run Stored Procedure
  4. Settled on an “un-well” known TCP Port to facilitate SQL Server Remote Access.
    Opened Firewall Rules to support it.

Now that the Environment is a bit setup, took the Easy Street and combed the .Net
for HelloDB code.

But, kept getting the error pasted below:


java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at DBConnect.getConnection(DBConnect.java:70)
at DBConnect.getConn(DBConnect.java:46)
at helloDB.main(helloDB.java:21)
Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver


Threw everything at the Problem:

  • Copied Microsoft’s JDBC Driver (sqljdbc4.jar) locally
  • Tweaked the CLASSPATH environment variable. As the Client is a Unix box
  • Learned to play “nice” with BASH
    • Used Export and unset to set & reset variable
  • Tried passing in the jar files via the -cp argument list
    • java -cp ./ helloDB
    • …. Note -cp ./ means that Java should check the local directory for Jar files
  • Copied the files to OS’s native location for JDBC Jar files

Finally gave up with trying to use Microsoft JDBC Driver. Downloaded JTDS changed a couple of lines:

1) Changed the name of the “Driver” class


Microsoft’s MS SQL Server Driver:


jDTS Driver:


2) Changed JDBC base URL

Microsoft’s MS SQL Server JDBC Driver:

jDTS Driver:

jDTS worked well, and without much changes either.

And, so now it is getting late and I am getting tired.

Did what I did not want to do, copied the files to a MS Windows box.

Really no additional setup needed as the Database Connectivity Software
are self-contained in the Jar files.

Reviewed the CLASSPATH and Invoked the App. The error message read:



java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at DBConnect_v2000.getConnection(DBConnect_v2000.java:70)
at DBConnect_v2000.getConn(DBConnect_v2000.java:46)
at helloDB.main(helloDB.java:23)
Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver


Goggled for that error message:

and found http://blogs.msdn.com/b/jdbcteam/archive/2007/06/15/java-lang-classnotfoundexception-com-microsoft-jdbc-sqlserver-sqlserverdriver.aspx

MS Doc clearly states that:

The class name has changed between the SQL Server 2000 JDBC driver and the SQL Server 2005 JDBC driver.  This particular class “com.microsoft.jdbc.sqlserver.SQLServerDriver” is the class name for the SQL Server 2000 JDBC driver.  The SQL Server 2005 JDBC driver class name is “com.microsoft.sqlserver.jdbc.SQLServerDriver“.
Note the change: from “microsoft.jdbc.sqlserver” to “microsoft.sqlserver.jdbc”

In addition, the SQL Server 2005 JDBC driver has a different URL prefix from the SQL Server 2000 JDBC driver.  The SQL Server 2000 JDBC driver uses an URL prefix of “jdbc:microsoft:sqlserver://”, while the SQL Server 2005 JDBC driver uses an URL prefix of “jdbc:sqlserver://“.
Note the removal of “microsoft” from the URL prefix.


So now we know what works:

Changed the name of the “Driver” class


Microsoft’s MS SQL Server Driver (v2000):



Microsoft’s MS SQL Server Driver (v2005):


please be extra careful with this one as the Class name looks the same – but the fact is that a couple of entries are inter-changed –  jdbc.sqlserver is now sqlserver.jdbc

2) Changed JDBC base URL


Microsoft’s MS SQL Server JDBC Driver (v2000):



Microsoft’s MS SQL Server JDBC Driver (v2005):


             please be a bit careful with this one as the the middle entry
             for microsoft is dropped


1) Using the JDBC Driver
2) How to Install Microsoft SQL Server JDBC
References (jDTS)

1) The jTDS Project
References (Setting the Classpath)

1) Setting the Classpath in Java
References (WebObjects)

1) WebObjects 5 : How to use Oracle JDBC Drivers

2) How do I install JDBC Driver on 10.5

References (MalcolmHardie Solutions)

1) Microsoft SQL Server and SQLEditor

References (Java for OS X Lion)

1) Java for OS X Lion Update 1
2) Java and the Mac OS
References (Java for OS X Lion – Issues )

1) Java for OS X Lion Update 1

References (Adobe)

1) Install the Java runtime (JRE) | Mac OS 10.7 Lion

References (sqljdbc.jar)

1) How to get Started with Microsoft JDBC
2) Working with a Connection

1) Running standalone Groovy Scripts