Sunday, 6 September 2015

How to add Google search in your page..


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Google search</title>
    </head>
    <body>
        <form method="get" action="http://www.google.com/search">
            <div>
                <table border="0" align="center" cellpadding="0">
                    <tr><td>
                            <input type="text"   name="q" size="25" style="color:#808080;"
                                   maxlength="255" placeholder="Search chinmay?" />
                        </td></tr>
                </table>
            </div>

        </form>
    </body>
</html>

Tuesday, 18 August 2015

How to fetch data from database and write into file in mysql



1) Normally we are selecting record from a table :
  select *from student
O/P: 100 chinmay kumar tripathy(In database)

2) If we have to write the record in a file then :
select * into outfile  'E:/chinmay/temp.txt' from student
O/P: 100 chinmay kumar tripathy(In file location E:/chinmay/temp.txt)

3) If we have to write the file in specific format then:

select * into outfile  'E:/chinmay/temp.txt 'FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n' from student
O/P: 100,"chinmay","kumar","tripathy" (In file location E:/chinmay/temp.txt)




Monday, 11 May 2015

How to get recent generated(auto generated) keys in mysql using Java at the time insertion

               pstmt = con.prepareStatement(strQuery, Statement.RETURN_GENERATED_KEYS);
               nRetValue = pstmt.executeUpdate();
                rsKeys = pstmt.getGeneratedKeys();
                rsKeys.next();
                generateKeys = rsKeys.getInt(1);

Sunday, 10 May 2015

Start Up My Blog

Hi everybody,
I m going to share my professional knowledge in this blog.
I need yours  comments ,compliments,and suggestion.

                                                                       Thanks