Skip to main content

Posts

Showing posts from April, 2012

JDBC Drivers for relational databases

JDBC (Java Database Connectivity) is an API that allows Java programs to access the database to read or modify data in databases. Below given are various databases and their Type 4(thin) JDBC driver details For each database I have given the driver name and the URL from where you can download the jdbc driver jar file. Oracle Driver name:  oracle.jdbc.driver.OracleDriver URL:  http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html (Drivers for various Oracle versions including 8i, 9i,10g, 11g are available here) Microsoft SQL Server Driver name:  com.microsoft.sqlserver.jdbc.SQLServerDriver URL:  http://www.microsoft.com/download/en/details.aspx?id=21599 ( This driver can connect to SQL Server 2008 R2, SQL Server 2008, SQL Server 2005 and SQL Server 2000 versions )    IBM DB2 Driver name:  java com.ibm.db2.jcc.DB2Jcc URL:   http://www-01.ibm.com/support/docview.wss?uid=swg21363866 ( DB2 Version 8.2 , DB2 Version 9.1, DB2 Versio

How to detect browser closing events and warn user before closing

Recently I came across this problem.I was creating a web application where users were supposed to save their work before logging out.While testing, it turned out that many users closed their browsers instead of logging out. To solve this, I googled the problem and found out that this was a very common problem. I just used below java script code in my webpage's header. Q. How to detect browser closing event and save your data Ans: The onunload event gets fired when the browser is closed or refreshed(using F5 or the refresh button). So now It turns out that the data was getting saved unnecessarily on refreshing the page. For that I stumbled across a forum where I found the solution.(It works for IE only) Q.How to disable function key F5? Ans: document.attachEvent("onkeydown", my_onkeydown_handler); function my_onkeydown_handler() { switch (event.keyCode) { case 116 : // 'F5' event.retur