<?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-7438015660541885057</id><updated>2024-08-30T22:47:37.830-07:00</updated><category term="jsp"/><category term="mysql connection"/><category term="servlet"/><title type='text'>Jsp Blogs</title><subtitle type='html'>Connect to Mysql to Jsp.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rajdeokumarsingh1.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><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>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7438015660541885057.post-1541472697300412212</id><published>2012-04-01T02:22:00.000-07:00</published><updated>2012-04-01T02:22:43.565-07:00</updated><title type='text'>How to Calculate the size of DataBase using mysql or schema?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
How to Calculate the size of DataBase using mysql or schema?

Ans:-

Query in mysql 


SELECT s.schema_name, CONCAT( IFNULL( ROUND( SUM( t.data_length ) /1024 /1024, 2 ) , 0.00 ) , &quot;Mb&quot; ) AS Data_size, CONCAT( IFNULL( ROUND( SUM( t.index_length ) /1024 /1024, 2 ) , 0.00 ) , &quot;Mb&quot; ) AS Index_size, COUNT( table_name ) total_tables
FROM INFORMATION_SCHEMA.SCHEMATA s
LEFT JOIN INFORMATION_SCHEMA.TABLES t ON s.schema_name = t.table_schema
WHERE s.schema_name NOT 
IN (
&quot;mysql&quot;, &quot;information_schema&quot;, &quot;test&quot;
)

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajdeokumarsingh1.blogspot.com/feeds/1541472697300412212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/04/how-to-calculate-size-of-database-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/1541472697300412212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/1541472697300412212'/><link rel='alternate' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/04/how-to-calculate-size-of-database-using.html' title='How to Calculate the size of DataBase using mysql or schema?'/><author><name>Unknown</name><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-7438015660541885057.post-5491601652791700243</id><published>2012-03-30T08:38:00.004-07:00</published><updated>2012-03-30T08:59:48.035-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsp"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql connection"/><category scheme="http://www.blogger.com/atom/ns#" term="servlet"/><title type='text'>how to create a connecction in mysql jsp?</title><content type='html'>How to create mysql connectiion using jsp?&lt;br /&gt;&lt;br /&gt;Ans:-&lt;br /&gt;Creating connection using mysql,jsp&lt;br /&gt;&lt;br /&gt;&lt;%@ page language=&quot;java&quot; import=&quot;java.sql.*&quot; %&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;%&lt;br /&gt;Connection con = null;&lt;br /&gt;String databaseDriver = &quot;com.mysql.jdbc.Driver&quot;;&lt;br /&gt;String connectionURL=&quot;&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;try {&lt;br /&gt;connectionURL = &quot;jdbc:mysql://localhost:3306/DataBaseName&quot;;&lt;br /&gt;Class.forName(databaseDriver).newInstance();&lt;br /&gt;&lt;br /&gt;con = DriverManager.getConnection(connectionURL, &quot;username&quot;, &quot;password&quot;);&lt;br /&gt;&lt;br /&gt;}catch(Exception e){&lt;br /&gt;out.print(&quot;Please wait &#39;http://rajdeokumarsingh1.blogspot.in/&#39; will be back soon &quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;%&gt;&lt;br /&gt;&lt;br /&gt;ow wait before doing this you have to put mySqlConnector.jar in lib folder of jdkx.xx.Ok &lt;br /&gt;&lt;br /&gt;Doooooooooooooooooooooooooooooone!!!!!!!!!!!!!!!&lt;br /&gt;&lt;br /&gt;you can download  mySqlConnector.jar from this site&lt;br /&gt;http://dev.mysql.com/downloads/connector/j/3.1.html &lt;br /&gt;&lt;br /&gt;Extract it and paste on lib folder that&#39;s it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now you done it&lt;br /&gt;&lt;br /&gt;Thanks</content><link rel='replies' type='application/atom+xml' href='http://rajdeokumarsingh1.blogspot.com/feeds/5491601652791700243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/03/creating-connection-in-mysql-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/5491601652791700243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/5491601652791700243'/><link rel='alternate' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/03/creating-connection-in-mysql-jsp.html' title='how to create a connecction in mysql jsp?'/><author><name>Unknown</name><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-7438015660541885057.post-4715166263497167095</id><published>2012-03-30T08:17:00.002-07:00</published><updated>2012-03-30T08:27:49.006-07:00</updated><title type='text'>How to Do Pagination using Jsp,Servlet ?</title><content type='html'>For Pagination first of all you need to create a connection using jsp.  i use the mysql server for data base.&lt;br /&gt;&lt;br /&gt;create a table in mysql.&lt;br /&gt;&lt;br /&gt;Create table pagination&lt;br /&gt;(&lt;br /&gt;id int ,&lt;br /&gt;title varchar (50),&lt;br /&gt;Description varchar(50),&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Step 2:create the Database Connection.&lt;br /&gt;&lt;br /&gt;create a connection.jsp file&lt;br /&gt;&lt;br /&gt;Simple code:-&lt;br /&gt;&lt;br /&gt;String connectionURL = &quot;jdbc:mysql://localhost:3306/DatabaseName&quot;;&lt;br /&gt;Connection con = null;&lt;br /&gt;Statement statement = null;&lt;br /&gt;ResultSet rs = null;&lt;br /&gt;Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance();&lt;br /&gt;con = DriverManager.getConnection(connectionURL, &quot;username&quot;, &quot;Password&quot;);&lt;br /&gt;&lt;br /&gt;save it to connection.jsp&lt;br /&gt;&lt;br /&gt;Connection Created&lt;br /&gt;&lt;br /&gt;Step 3:- Create a search.jsp file &lt;br /&gt;&lt;br /&gt;&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&lt;br /&gt;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;&lt;br /&gt;&lt;%@ page import=&quot;java.sql.*&quot; %&gt;&lt;br /&gt;&lt;%@ page import=&quot;java.io.*&quot; %&gt; &lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;display data from the table using jsp&lt;/title&gt;&lt;br /&gt;&lt;style&gt;&lt;br /&gt;#indexing{CLEAR: both; MARGIN: 0px 0px 0px 5px; COLOR:#669999; padding-top:3px; POSITION: relative; TOP: 5px;  HEIGHT: 2em}#indexing A.indexing {BORDER-RIGHT: #ccdbe4 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #ccdbe4 1px solid; DISPLAY: block; PADDING-LEFT: 8px; FLOAT: left; PADDING-BOTTOM: 1px; MARGIN: 0px 5px 0px 0px; BORDER-LEFT: #ccdbe4 1px solid; COLOR: #669999; PADDING-TOP: 1px; BORDER-BOTTOM: #ccdbe4 1px solid; TEXT-ALIGN: center; TEXT-DECORATION: none}#indexing STRONG {BORDER-RIGHT: #ccdbe4 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #ccdbe4 1px solid; DISPLAY: block; PADDING-LEFT: 8px; FLOAT: left; PADDING-BOTTOM: 1px; MARGIN: 0px 5px 0px 0px; BORDER-LEFT: #ccdbe4 1px solid; COLOR: #669999; PADDING-TOP: 1px; BORDER-BOTTOM: #ccdbe4 1px solid; TEXT-ALIGN: center; TEXT-DECORATION: none}#indexing A.indexing:hover {BORDER-LEFT-COLOR: #2b55af; BACKGROUND: #669999; BORDER-BOTTOM-COLOR: #2b55af; COLOR: #fff; BORDER-TOP-COLOR: #2b55af; BORDER-RIGHT-COLOR: #2b55af}#indexing STRONG {BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 6px; PADDING-LEFT: 6px; FONT-WEIGHT: bold; BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 107%; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 2px; COLOR: #000; PADDING-TOP: 2px; BORDER-RIGHT-WIDTH: 0px}#indexing #indexing-next {BORDER-TOP-WIDTH: 2px; MARGIN-TOP: -2px; BORDER-LEFT-WIDTH: 2px; BORDER-BOTTOM-WIDTH: 2px; PADDING-BOTTOM: 1px; FONT: 114% Tahoma,Helvetica,sans-serif; PADDING-TOP: 1px; BORDER-RIGHT-WIDTH: 2px}#indexing #indexing-prev {BORDER-TOP-WIDTH: 2px; MARGIN-TOP: -2px; BORDER-LEFT-WIDTH: 2px; BORDER-BOTTOM-WIDTH: 2px; PADDING-BOTTOM: 1px; FONT: 114% Tahoma,Helvetica,sans-serif; PADDING-TOP: 1px; BORDER-RIGHT-WIDTH: 2px}#indexing #indexing-next {MARGIN-LEFT: 9px}#indexing #indexing-prev {MARGIN-RIGHT: 14px}&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;h2&gt;Welcome to music | Movie Search Engine&lt;/h2&gt;&lt;br /&gt;&lt;%@include file=&quot;music.html&quot;%&gt;&lt;br /&gt;/*&lt;br /&gt;String connectionURL = &quot;jdbc:mysql://localhost:3306/&quot;;&lt;br /&gt;Connection con = null;&lt;br /&gt;Statement statement = null;&lt;br /&gt;ResultSet rs = null;&lt;br /&gt;Class.forName(&quot;com.mysql.jdbc.Driver&quot;).newInstance();&lt;br /&gt;con = DriverManager.getConnection(connectionURL, &quot;&quot;, &quot;&quot;);&lt;br /&gt;*/&lt;br /&gt;&lt;%@ include file=&quot;connection.jsp&quot;%&gt;&lt;br /&gt;&lt;%&lt;br /&gt;Statement statement = null;&lt;br /&gt;ResultSet rs = null;&lt;br /&gt;&lt;br /&gt;try {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;statement = con.createStatement();&lt;br /&gt;&lt;br /&gt;String qs=request.getParameter(&quot;q&quot;);&lt;br /&gt;if(qs==null)&lt;br /&gt;qs=&quot;&quot;;&lt;br /&gt;&lt;br /&gt;String item=request.getParameter(&quot;item&quot;);&lt;br /&gt;if(item==null){item=&quot;0&quot;;}&lt;br /&gt;int indexcounter=Integer.parseInt(item);&lt;br /&gt;&lt;br /&gt;String query1 = &quot;select count(*) from music_search where title LIKE &#39;%&quot;+qs+&quot;%&#39; order by id desc limit &quot;+indexcounter+&quot;, 5&quot;;&lt;br /&gt;&lt;br /&gt;   Statement stat1 = con.createStatement();&lt;br /&gt;         ResultSet rs1 = stat1.executeQuery(query1);&lt;br /&gt;   rs1.next();&lt;br /&gt;   int resultcounter=0;&lt;br /&gt;   //resultcounter_blankresult=resultcounter;&lt;br /&gt;   resultcounter=rs1.getInt(1); &lt;br /&gt;&lt;br /&gt;String QueryString = &quot;SELECT * from music_search where title LIKE &#39;%&quot;+qs+&quot;%&#39; order by id desc limit &quot;+indexcounter+&quot;, 5&quot;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rs = statement.executeQuery(QueryString);&lt;br /&gt;%&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;TABLE width=&quot;421&quot; border=&quot;1&quot; align=&quot;center&quot; cellpadding=&quot;15&quot; style=&quot;background-color: #ffffcc;&quot;&gt;&lt;br /&gt;&lt;%&lt;br /&gt;while (rs.next()) {&lt;br /&gt;&lt;br /&gt;%&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;  &lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;TR&gt;&lt;br /&gt;&lt;br /&gt;&lt;TD width=&quot;104&quot;&gt;&lt;%=rs.getString(1)%&gt;&lt;/TD&gt;&lt;br /&gt;&lt;br /&gt;&lt;TD width=&quot;245&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;%=rs.getString(2)%&gt;&lt;/a&gt;&lt;/TD&gt;&lt;br /&gt;&lt;/TR&gt;&lt;br /&gt;&lt;%}%&gt;&lt;br /&gt;&lt;br /&gt;&lt;%&lt;br /&gt;// close all the connections.&lt;br /&gt;}catch (Exception ex){&lt;br /&gt;%&gt;&lt;br /&gt;&lt;%&lt;br /&gt;out.println(&quot;Unable to connect to database.&quot;);&lt;br /&gt;}&lt;br /&gt;%&gt;&lt;br /&gt;&lt;/TABLE&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajdeokumarsingh1.blogspot.com/feeds/4715166263497167095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/03/how-to-do-pagination-using-jspservlet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/4715166263497167095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438015660541885057/posts/default/4715166263497167095'/><link rel='alternate' type='text/html' href='http://rajdeokumarsingh1.blogspot.com/2012/03/how-to-do-pagination-using-jspservlet.html' title='How to Do Pagination using Jsp,Servlet ?'/><author><name>Unknown</name><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>