<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1203232201189400181</id><updated>2024-09-24T18:26:45.049+05:30</updated><title type='text'>java-programs</title><subtitle type='html'>you can get form this blog the following programs on  &#xa;1.core java&#xa;2.jdbc&#xa;3.servlets&#xa;4.jsp&#xa;5.struts &#xa;6.hibernate</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-3737609021870761927</id><published>2011-02-11T11:45:00.005+05:30</published><updated>2011-02-11T11:45:37.575+05:30</updated><title type='text'>BatchUpdates</title><content type='html'>import java.sql.*;&lt;br /&gt;
class BatchUpdates&lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  String s1=&quot;insert into emp3 values(1,&#39;rahul&#39;)&quot;;&lt;br /&gt;
  String s2=&quot;insert into emp3 values(2,&#39;arun&#39;)&quot;;&lt;br /&gt;
  String s3=&quot;insert into emp3 values(3,&#39;pavan&#39;)&quot;;&lt;br /&gt;
  String s4=&quot;insert into emp3 values(4,&#39;gopi&#39;)&quot;;&lt;br /&gt;
  String s5=&quot;insert into emp3 values(2,&#39;arun&#39;)&quot;;&lt;br /&gt;
  String s6=&quot;insert into emp3 values(2,&#39;arun&#39;)&quot;;&lt;br /&gt;
  stmt.addBatch(s1);&lt;br /&gt;
  stmt.addBatch(s2);&lt;br /&gt;
  stmt.addBatch(s3);&lt;br /&gt;
  stmt.addBatch(s4);&lt;br /&gt;
  stmt.addBatch(s5);&lt;br /&gt;
  stmt.addBatch(s6);&lt;br /&gt;
  int a[]=stmt.executeBatch();&lt;br /&gt;
  for(int i=0;i&lt;=a.length;i++)
  {
  System.out.println(&quot;no of rows inserted:-------&gt;&quot;+a[i]);&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/3737609021870761927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/batchupdates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/3737609021870761927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/3737609021870761927'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/batchupdates.html' title='BatchUpdates'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-8871794108185062392</id><published>2011-02-11T11:45:00.003+05:30</published><updated>2011-02-11T11:45:15.242+05:30</updated><title type='text'>CallableStmt</title><content type='html'>import java.sql.*;&lt;br /&gt;
class CallableStmt&lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  CallableStatement pstmt=con.prepareCall(&quot;{call proc(?,?)}&quot;);&lt;br /&gt;
  pstmt.setInt(1,10);&lt;br /&gt;
  pstmt.setString(2,&quot;arun&quot;);&lt;br /&gt;
  pstmt.execute();&lt;br /&gt;
  System.out.println(&quot;insert record is with Prepare Statement......&quot;);&lt;br /&gt;
  con.close();&lt;br /&gt;
  System.out.println(&quot;connection is closed&quot;);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/8871794108185062392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/callablestmt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8871794108185062392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8871794108185062392'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/callablestmt.html' title='CallableStmt'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-389084136607239825</id><published>2011-02-11T11:44:00.005+05:30</published><updated>2011-02-11T11:44:49.221+05:30</updated><title type='text'>PrepareStmtInput</title><content type='html'>import java.io.*;&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
class PrepareStmtInput&lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  PreparedStatement pstmt=con.prepareStatement(&quot;insert into emp3 values(?,?)&quot;);&lt;br /&gt;
  System.out.println(&quot;Enteer emp no&quot;);&lt;br /&gt;
  int empno=Integer.parseInt(br.readLine());&lt;br /&gt;
  pstmt.setInt(1,empno);&lt;br /&gt;
  System.out.println(&quot;enter emp name&quot;);&lt;br /&gt;
  String empname=br.readLine();&lt;br /&gt;
  pstmt.setString(2,&quot;empname&quot;);&lt;br /&gt;
  int a=pstmt.executeUpdate();&lt;br /&gt;
  System.out.println(&quot;insert record is with Prepare Statement......&quot;+a);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/389084136607239825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestmtinput.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/389084136607239825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/389084136607239825'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestmtinput.html' title='PrepareStmtInput'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-2162835775744689176</id><published>2011-02-11T11:44:00.003+05:30</published><updated>2011-02-11T11:44:26.294+05:30</updated><title type='text'>PrepareStmt</title><content type='html'>import java.sql.*;&lt;br /&gt;
class PrepareStmt&lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  PreparedStatement pstmt=con.prepareStatement(&quot;insert into emp3 values(?,?)&quot;);&lt;br /&gt;
  pstmt.setInt(1,10);&lt;br /&gt;
  pstmt.setString(2,&quot;anjali&quot;);&lt;br /&gt;
  int a=pstmt.executeUpdate();&lt;br /&gt;
  System.out.println(&quot;insert record is with Prepare Statement......&quot;+a);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/2162835775744689176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestmt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2162835775744689176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2162835775744689176'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestmt.html' title='PrepareStmt'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-5039559986712282277</id><published>2011-02-11T11:44:00.001+05:30</published><updated>2011-02-11T11:44:02.055+05:30</updated><title type='text'>Prepare_statement</title><content type='html'>// PrepareStatement retriving the values from table student in a database &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Prepare_statement&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
PreparedStatement pstmt=con.prepareStatement(&quot;select *from student where sno=?&quot;);&lt;br /&gt;
System.out.println(&quot;preparedStatement object is created&quot;);&lt;br /&gt;
pstmt.setInt(1,15);&lt;br /&gt;
ResultSet rs=pstmt.executeQuery();&lt;br /&gt;
System.out.println(&quot;sno&quot;+&quot; &quot;+&quot;name&quot;+&quot; &quot;+&quot;place&quot;);&lt;br /&gt;
System.out.println(&quot;--------------------------------------&quot;);&lt;br /&gt;
while(rs.next())&lt;br /&gt;
{&lt;br /&gt;
System.out.println();&lt;br /&gt;
System.out.print(rs.getInt(&quot;sno&quot;)+&quot;     &quot;);&lt;br /&gt;
System.out.print(rs.getString(&quot;name&quot;)+&quot;    &quot;);&lt;br /&gt;
System.out.print(rs.getString(&quot;place&quot;));&lt;br /&gt;
}&lt;br /&gt;
pstmt.executeQuery();&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
prepared statement is improves the performence&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/5039559986712282277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestatement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5039559986712282277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5039559986712282277'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/preparestatement.html' title='Prepare_statement'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-5915902756397976547</id><published>2011-02-11T11:43:00.004+05:30</published><updated>2011-02-11T11:43:34.395+05:30</updated><title type='text'>Retrive_Records</title><content type='html'>//Retriving the values from table student in a database&lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Retrive_Records&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
ResultSet rs=stmt.executeQuery(&quot;select *from student&quot;);&lt;br /&gt;
System.out.println(&quot;sno&quot;+&quot; &quot;+&quot;name&quot;+&quot; &quot;+&quot;place&quot;);&lt;br /&gt;
System.out.println(&quot;--------------------------------------&quot;);&lt;br /&gt;
while(rs.next())&lt;br /&gt;
{&lt;br /&gt;
System.out.println();&lt;br /&gt;
System.out.print(rs.getInt(&quot;sno&quot;)+&quot;     &quot;);&lt;br /&gt;
System.out.print(rs.getString(&quot;name&quot;)+&quot;    &quot;);&lt;br /&gt;
System.out.print(rs.getString(&quot;place&quot;));&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
For Select Querys we have to use the &quot;executeQuery&quot; method &lt;br /&gt;
it return the Results into a ResultSet object&lt;br /&gt;
by using next() method we can move the next row from one row to anethor&lt;br /&gt;
here we used differnt type getter method(we can use getString() for all data types)&lt;br /&gt;
but its not recomended&lt;br /&gt;
TRy with different type select querys&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/5915902756397976547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/retriverecords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5915902756397976547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5915902756397976547'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/retriverecords.html' title='Retrive_Records'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-7360391586604144040</id><published>2011-02-11T11:43:00.002+05:30</published><updated>2011-02-11T11:43:02.871+05:30</updated><title type='text'>UpdateRecord</title><content type='html'>import java.sql.*;&lt;br /&gt;
class UpdateRecord &lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  int a=stmt.executeUpdate(&quot;update emp3 where name=&#39;rahul&#39;&quot;);&lt;br /&gt;
  System.out.println(&quot;no of rows are Updated:-------&gt;&quot;+a);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/7360391586604144040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/updaterecord.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7360391586604144040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7360391586604144040'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/updaterecord.html' title='UpdateRecord'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-5903657019826175469</id><published>2011-02-11T11:42:00.002+05:30</published><updated>2011-02-11T11:42:43.859+05:30</updated><title type='text'>Update_Records</title><content type='html'>//Updating values in table student &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Update_Records&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
int a=stmt.executeUpdate(&quot;update student set sno=15 where sno=1&quot;);&lt;br /&gt;
System.out.println(&quot;Values are updated -------&gt; &quot;+a);&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Here we use a SQL update Query &lt;br /&gt;
and it returns an interger value it indicates that how many record are updated.&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/5903657019826175469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/updaterecords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5903657019826175469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5903657019826175469'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/updaterecords.html' title='Update_Records'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-3350570808746461773</id><published>2011-02-11T11:41:00.003+05:30</published><updated>2011-02-11T11:41:57.195+05:30</updated><title type='text'>Statement_obj</title><content type='html'>//Creating a Statement reference &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Statement_obj&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Here we are not creating a Statement object but &lt;br /&gt;
we are creating a reference variable to Statement interface&lt;br /&gt;
and we are creating a object which implements the Statement interface&lt;br /&gt;
(Most of the Techniclal Lazy people calls it as Statement object)&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/3350570808746461773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/statementobj.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/3350570808746461773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/3350570808746461773'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/statementobj.html' title='Statement_obj'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-7348611435552025280</id><published>2011-02-11T11:41:00.001+05:30</published><updated>2011-02-11T11:41:27.648+05:30</updated><title type='text'>Table_create</title><content type='html'>//Creating a Table using java programe &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Table_create&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
stmt.executeUpdate(&quot;create table student(sno number(5),name varchar2(10),place varchar2(10))&quot;);&lt;br /&gt;
System.out.println(&quot;Table is crated -------&gt; &quot;);&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Here we are used a method &quot;executeUpdate()&quot; it takes one parameter &lt;br /&gt;
as argument i.e SQL Query &lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/7348611435552025280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/tablecreate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7348611435552025280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7348611435552025280'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/tablecreate.html' title='Table_create'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-7682293533335806728</id><published>2011-02-11T11:40:00.003+05:30</published><updated>2011-02-11T11:40:42.882+05:30</updated><title type='text'>DisplayRecordIndex</title><content type='html'>//Retrive the data from DB and display it Using with INDEXS&lt;br /&gt;
 import java.sql.*;&lt;br /&gt;
 import java.sql.*;&lt;br /&gt;
class DisplayRecordIndex&lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  ResultSet rs=stmt.executeQuery(&quot;select eno,name from emp3&quot;);&lt;br /&gt;
  System.out.println(rs);&lt;br /&gt;
  while(rs.next())&lt;br /&gt;
  {&lt;br /&gt;
   int deno=rs.getInt(1);&lt;br /&gt;
   System.out.println(&quot;Eno:   &quot;+deno);&lt;br /&gt;
   String s=rs.getString(2);&lt;br /&gt;
   System.out.println(&quot;Nane:      &quot;+s);&lt;br /&gt;
  }&lt;br /&gt;
  con.close();&lt;br /&gt;
  System.out.println(&quot;connection is closed&quot;);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/7682293533335806728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/displayrecordindex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7682293533335806728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7682293533335806728'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/displayrecordindex.html' title='DisplayRecordIndex'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-1294725813861378565</id><published>2011-02-11T11:40:00.001+05:30</published><updated>2011-02-11T11:40:15.633+05:30</updated><title type='text'>DisplayRecord</title><content type='html'>import java.sql.*;&lt;br /&gt;
class DisplayRecord &lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  ResultSet rs=stmt.executeQuery(&quot;select eno,name from emp3&quot;);&lt;br /&gt;
  System.out.println(rs);&lt;br /&gt;
  while(rs.next())&lt;br /&gt;
  {&lt;br /&gt;
   int deno=rs.getInt(&quot;eno&quot;);&lt;br /&gt;
   System.out.println(&quot;Eno:   &quot;+deno);&lt;br /&gt;
   String s=rs.getString(&quot;name&quot;);&lt;br /&gt;
   System.out.println(&quot;Nane:      &quot;+s);&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/1294725813861378565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/displayrecord.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/1294725813861378565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/1294725813861378565'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/displayrecord.html' title='DisplayRecord'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-2883685823294366995</id><published>2011-02-11T11:39:00.002+05:30</published><updated>2011-02-11T11:39:45.242+05:30</updated><title type='text'>DeleteRecord</title><content type='html'>import java.sql.*;&lt;br /&gt;
class DeleteRecord &lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  int a=stmt.executeUpdate(&quot;delete from emp3 where eno=1&quot;);&lt;br /&gt;
  System.out.println(&quot;no of rows DeleteRecord:-------&gt;&quot;+a);&lt;br /&gt;
  con.close();&lt;br /&gt;
  System.out.println(&quot;connection is closed&quot;);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/2883685823294366995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/deleterecord.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2883685823294366995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2883685823294366995'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/deleterecord.html' title='DeleteRecord'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-7433923033633122733</id><published>2011-02-11T11:38:00.005+05:30</published><updated>2011-02-11T11:38:58.047+05:30</updated><title type='text'>Delete_Records</title><content type='html'>//Deleting values in table student &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Delete_Records&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
int a=stmt.executeUpdate(&quot;delete from student where sno=1&quot;);&lt;br /&gt;
System.out.println(&quot;Values are deleted -------&gt; &quot;+a);&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Here we use a SQL update Query &lt;br /&gt;
and it returns an interger value it indicates that how many record are deleted.&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/7433923033633122733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/deleterecords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7433923033633122733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/7433923033633122733'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/deleterecords.html' title='Delete_Records'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-8981713602423226296</id><published>2011-02-11T11:38:00.002+05:30</published><updated>2011-02-11T11:38:22.488+05:30</updated><title type='text'>InsertRecord</title><content type='html'>import java.sql.*;&lt;br /&gt;
class InsertRecord &lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  int a=stmt.executeUpdate(&quot;insert into emp3 values(1,&#39;rahul&#39;)&quot;);&lt;br /&gt;
  System.out.println(&quot;no of rows inserted:-------&gt;&quot;+a);&lt;br /&gt;
  con.close();&lt;br /&gt;
  System.out.println(&quot;connection is closed&quot;);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/8981713602423226296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/insertrecord.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8981713602423226296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8981713602423226296'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/insertrecord.html' title='InsertRecord'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-4632381992003532263</id><published>2011-02-11T11:37:00.001+05:30</published><updated>2011-02-11T11:37:28.281+05:30</updated><title type='text'>Insert_Records</title><content type='html'>//inserting values into a table student &lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class Insert_Records&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;
Statement stmt=con.createStatement();&lt;br /&gt;
System.out.println(&quot;Statement object is created&quot;);&lt;br /&gt;
int a=stmt.executeUpdate(&quot;insert into student values(1,&#39;rahul&#39;,&#39;hyd&#39;)&quot;);&lt;br /&gt;
System.out.println(&quot;Values are inseted -------&gt; &quot;+a);&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Here we use a SQL insert Query &lt;br /&gt;
and it returns an interger value it indicates that how many record are inseted.&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/4632381992003532263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/insertrecords.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4632381992003532263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4632381992003532263'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/insertrecords.html' title='Insert_Records'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-1463177076226470918</id><published>2011-02-11T11:36:00.002+05:30</published><updated>2011-02-11T11:36:51.751+05:30</updated><title type='text'>DBConnect</title><content type='html'>import java.sql.*;&lt;br /&gt;
class DBConnect &lt;br /&gt;
{&lt;br /&gt;
 public static void main(String[] args) throws Exception&lt;br /&gt;
 {&lt;br /&gt;
  DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
  Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;
  Statement stmt=con.createStatement();&lt;br /&gt;
  stmt.executeUpdate(&quot;create table emp3(eno number(5),name varchar2(20))&quot;);&lt;br /&gt;
  System.out.println(&quot;table is created......&quot;);&lt;br /&gt;
  con.close();&lt;br /&gt;
  System.out.println(&quot;connection is closed&quot;);&lt;br /&gt;
 }&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/1463177076226470918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/dbconnect_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/1463177076226470918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/1463177076226470918'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/dbconnect_11.html' title='DBConnect'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-5383130205296455614</id><published>2011-02-11T11:28:00.000+05:30</published><updated>2011-02-11T11:28:33.112+05:30</updated><title type='text'>JDBC</title><content type='html'>//Register orclae or thin driver using jdbc api&lt;br /&gt;
&lt;br /&gt;
import java.sql.*;&lt;br /&gt;
public class DBRegister&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])&lt;br /&gt;
{&lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;
System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;
}&lt;br /&gt;
catch(Exception e)&lt;br /&gt;
{&lt;br /&gt;
e.printStackTrace();&lt;br /&gt;
System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
To execute this program we have to set the class path for &quot;ojdbc14.jar&quot; file&lt;br /&gt;
From the above programe &quot;DriverManager&quot; is a static class &lt;br /&gt;
&quot;registerDriver&quot; is method it takes one arugument i.e object of OracleDriver class&lt;br /&gt;
which is under &quot;oracle.jdbc.driver&quot; package&lt;br /&gt;
&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/5383130205296455614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/jdbc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5383130205296455614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5383130205296455614'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/jdbc.html' title='JDBC'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-2340361126916220169</id><published>2011-02-09T19:17:00.000+05:30</published><updated>2011-02-09T19:18:32.411+05:30</updated><title type='text'>Getting Connection from DataBase</title><content type='html'>//get connection from DataBase using orclae or thin driver using jdbc api&lt;br /&gt;&lt;br /&gt;import java.sql.*;&lt;br /&gt;public class DBConnection&lt;br /&gt;{&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;Connection con=DriverManager.getConnection(&quot;jdbc:oracle:thin:@localhost:1521:xe&quot;,&quot;system&quot;,&quot;system&quot;);&lt;br /&gt;System.out.println(&quot;Connection is established to DB&quot;);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;e.printStackTrace();&lt;br /&gt;System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;Explanation:&lt;br /&gt;&lt;br /&gt;To get Connetion we has used &quot;Connetion&quot; interface &lt;br /&gt;and getConnection method takes three parameters&lt;br /&gt;&lt;br /&gt;1:URL &lt;br /&gt;2:user name&lt;br /&gt;3:password&lt;br /&gt;&lt;br /&gt;*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/2340361126916220169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/getting-connection-from-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2340361126916220169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2340361126916220169'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/getting-connection-from-database.html' title='Getting Connection from DataBase'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-8771913684239224105</id><published>2011-02-09T19:13:00.000+05:30</published><updated>2011-02-09T19:16:37.634+05:30</updated><title type='text'>Registering Drivers</title><content type='html'>//Register orclae or thin driver using jdbc api&lt;br /&gt;&lt;br /&gt;import java.sql.*;&lt;br /&gt;public class DBRegister&lt;br /&gt;{&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());&lt;br /&gt;System.out.println(&quot;thin driver is registerd&quot;);&lt;br /&gt;}&lt;br /&gt;catch(Exception e)&lt;br /&gt;{&lt;br /&gt;e.printStackTrace();&lt;br /&gt;System.out.println(&quot;Registeration faild&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;Explanation:&lt;br /&gt;&lt;br /&gt;To execute this program we have to set the class path for &quot;ojdbc14.jar&quot; file&lt;br /&gt;From the above programe &quot;DriverManager&quot; is a static class &lt;br /&gt;&quot;registerDriver&quot; is method it takes one arugument i.e object of OracleDriver class&lt;br /&gt;which is under &quot;oracle.jdbc.driver&quot; package&lt;br /&gt;&lt;br /&gt;*/</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/8771913684239224105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/registering-drivers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8771913684239224105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/8771913684239224105'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/registering-drivers.html' title='Registering Drivers'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-4891882716212873448</id><published>2011-02-04T11:58:00.002+05:30</published><updated>2011-02-04T11:59:12.610+05:30</updated><title type='text'>read string</title><content type='html'>// input from key board&lt;br /&gt;import java.io.*;&lt;br /&gt;class Inputstring&lt;br /&gt;{&lt;br /&gt;public static void main(String r[])throws IOException&lt;br /&gt;{&lt;br /&gt;//InputStreamReader id=new InputStreamReader(System.in);&lt;br /&gt;BufferedReader br=new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;System.out.println(&quot;enter a String vslue&quot;);&lt;br /&gt;String s=br.readLine();&lt;br /&gt;System.out.println(&quot;enter       &quot;+s);&lt;br /&gt;}&lt;br /&gt;}</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/4891882716212873448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/read-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4891882716212873448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4891882716212873448'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/read-string.html' title='read string'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-4345306210081619751</id><published>2011-02-04T11:58:00.001+05:30</published><updated>2011-02-04T11:58:42.167+05:30</updated><title type='text'>read integer</title><content type='html'>&lt;div&gt;// input from key board&lt;/div&gt;&lt;div&gt;import java.io.*;&lt;/div&gt;&lt;div&gt;class Inputint&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;public static void main(String r[])throws IOException&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;InputStreamReader id=new InputStreamReader(System.in);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;BufferedReader br=new BufferedReader(id);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;enter a interger&quot;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;int s=Integer.parseInt(br.readLine());&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;enter       &quot;+s);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/4345306210081619751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/read-integer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4345306210081619751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/4345306210081619751'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/read-integer.html' title='read integer'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-6474601931696397380</id><published>2011-02-04T11:57:00.001+05:30</published><updated>2011-02-04T11:57:41.911+05:30</updated><title type='text'>arthemetic operators using switch</title><content type='html'>&lt;div&gt;//arthemetic operators using switch&lt;/div&gt;&lt;div&gt;import java.io.*;&lt;/div&gt;&lt;div&gt;class  Input2&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;public static void main(String[] args)throws IOException&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;char ch;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;InputStreamReader ir=new InputStreamReader(System.in);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;BufferedReader br=new BufferedReader(ir);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;enter values of x&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;int x=Integer.parseInt(br.readLine());&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;enter values of y&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;int y=Integer.parseInt(br.readLine());&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;enter u r choice&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;+ for additon&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;- for subtraction&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;/ for divide&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;* for multipiy&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;System.out.println(&quot;% for remainder&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;ch=(char)br.read();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;switch(ch)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;case &#39;+&#39;:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;System.out.println(&quot;additon:&quot;+(x+y));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;case &#39;-&#39;:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;System.out.println(&quot;sub:&quot;+(x-y));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;case &#39;*&#39;:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;System.out.println(&quot;mul:&quot;+(x*y));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;case &#39;/&#39;:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;System.out.println(&quot;divide:&quot;+(x/y));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;case &#39;%&#39;:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Remainder:&quot;+(x%y));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/6474601931696397380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/arthemetic-operators-using-switch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/6474601931696397380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/6474601931696397380'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/arthemetic-operators-using-switch.html' title='arthemetic operators using switch'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-5879065202300418812</id><published>2011-02-04T11:56:00.000+05:30</published><updated>2011-02-04T11:57:10.223+05:30</updated><title type='text'>input from key board</title><content type='html'>&lt;div&gt;// input from key board&lt;/div&gt;&lt;div&gt;import java.io.*;&lt;/div&gt;&lt;div&gt;class Input1  &lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;public static void main(String r[])throws IOException&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;//InputStreamReader id=new InputStreamReader(System.in);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;BufferedReader br=new BufferedReader(new InputStreamReader(System.in));&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;System.out.println(&quot;enter a double vslue&quot;);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;double s=Double.parseDouble(br.readLine());&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;System.out.println(&quot;enter       &quot;+s);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/5879065202300418812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/input-from-key-board.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5879065202300418812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/5879065202300418812'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/input-from-key-board.html' title='input from key board'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1203232201189400181.post-2413796396318932552</id><published>2011-02-04T11:55:00.000+05:30</published><updated>2011-02-04T11:56:42.074+05:30</updated><title type='text'>InputStreamReader</title><content type='html'>&lt;div&gt;// input from key board&lt;/div&gt;&lt;div&gt;import java.io.*;&lt;/div&gt;&lt;div&gt;class Input&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;public static void main(String r[])throws IOException&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;InputStreamReader id=new InputStreamReader(System.in);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;BufferedReader br=new BufferedReader(id);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;System.out.println(&quot;enter achar&quot;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;char ch=(char)br.read();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;System.out.println(&quot;enter       &quot;+ch);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-programes.blogspot.com/feeds/2413796396318932552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-programes.blogspot.com/2011/02/inputstreamreader.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2413796396318932552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1203232201189400181/posts/default/2413796396318932552'/><link rel='alternate' type='text/html' href='http://java-programes.blogspot.com/2011/02/inputstreamreader.html' title='InputStreamReader'/><author><name>Java Rules</name><uri>http://www.blogger.com/profile/09618135927371765100</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>