<input type="button" value="Cick Me" onclick="show()">
<script>
function show(){
alert("This is a test");
}
</script>
Here as you see I used <script> means it default treated as <script language="javascript">
Lest See another example..
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<table>
<tr><td>Please Enter Your Name:</td><td><input type="text" id="name"></td></tr>
<tr><td> </td><td><input type="button" onClick="test()" value="Click on Me."></td></tr>
</table>
</body>
<script language="javascript">
function test()
{
var name=document.getElementById('name').value;
alert("Welcome"+name);
}
</script>
</html>
This is My Fist Program For Hibernate. Using Eclipse It requires three things. 1. Simple bean class 2. Simple Hibernating Mapping Xml file. 3.Hibernate Configuration File. 4. And the one Main class under the scr folder.
In scr folder create the following package.
com.vikash.core.bean
now ceate the class Student.java
as follows
package com.vikash.core.beans;
public class Student {
long id;
String name;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
create the file student.hbm.xml at the same place as Student.java resides.
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.vikash.core.beans.Student" table="STD_TABLE">
<id name="id" type="long" column="ID">
<generator class="assigned"/>
</id>
<property name="name">
<column name="STD_NAME"/>
</property>
</class>
</hibernate-mapping>
now in src folder create the file name hibernate.cfg.xml
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">