How to insert image in oracle database using java? |Insert Image In To Oracle Data Base Using Servlet, Jdbc

In this tutorial we will see how to insert data into oracle data base using java program/application.
Prerequisites:
  1. All configuration must me done to connect java
    application to oracle before starting this task. As described in my previous tutorial 'How to connect java application with oracle database'.
Steps: 
1.First start your oracle database and create a table of your choice. eg - create table student (id number(3), name varchar2(30),class number(2),marks number(3));
2. Now open IDE and write down the java code for the application which will connect to the oracle database and enter the data to the specific table.
3. After compilation and execution. You will get data inserted in the database.

Source Code for 'Inserting data into oracle database using java program/application':

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class InsertRecord {

public static void main(String[] args) {

String driver="sun.jdbc.odbc.JdbcOdbcDriver";
String cs="jdbc:odbc:connect_oracle";
String user = "system";
String pwd = "tom";
String sqlstmt="INSERT INTO STUDENT VALUES(1,'Steve',5,70)";
Connection con = null;
Statement st = null;
try
{
Class.forName(driver);
}
catch(Exception e)
{
System.out.println(e);
}
System.out.println("Driver loaded");
try
{
con=DriverManager.getConnection(cs,user,pwd);
System.out.println("Connected to the Oracle Database");
st = con.createStatement();//creates a Statement object for sending SQL statements to the database.
int updatecount=st.executeUpdate(sqlstmt);//return either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing
System.out.println(updatecount+" row inserted");
}
catch(Exception e)
{
System.out.println(e);
}
try
{
st.close();
con.close();
}
catch(Exception e)
{
System.out.println(e);
}
}//main()
}//class()

How to create a simple JavaScript countdown timer? |A Simple JavaScript Countdown - JavaScript / Java

This JavaScript tutorial shows up the algorithm to make a simple countdown timer on your web pages, only with a few code lines.

<script type="text/javascript">
var millisecs_per_day=86400000
// set countdown time in milliseconds
// put desired day as arguments to Date.UTC
// in the order:
// year, month (remember January is 0), day of month, offset from GMT
// NOTE: we are using the offset because that represents midnight
// (beginning of the day) in a specific timezone
var countdown_time=Date.UTC(2008,7,8,-8);
// get the current time and convert to milliseconds
var now=new Date();
var now_millisecs=now.valueOf();

var day_cnt= Math.ceil(( countdown_time - now_millisecs)/86400000 )

// display the number of days left (or since)
if ( day_cnt > 1 )
{
// multiple days to go
document.write( day_cnt + " days to go")
}
else if ( day_cnt == 1 )
{
// one day to go
document.write( day_cnt + " day to go")
}
else if ( day_cnt == 0 )
{
// it's today
document.write( "today")
}
else if ( day_cnt == -1 )
{
// one day ago
document.write( day_cnt + " day ago")
}
else
{
// multiple days ago
document.write( day_cnt + " days ago")
}
</script>