<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sridhar</title>
	<atom:link href="http://sridharword.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sridharword.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 26 Jun 2009 02:28:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sridharword.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sridhar</title>
		<link>http://sridharword.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sridharword.wordpress.com/osd.xml" title="Sridhar" />
	<atom:link rel='hub' href='http://sridharword.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Connect MySql DataBase From Java</title>
		<link>http://sridharword.wordpress.com/2009/06/24/connect-mysql-database-from-java/</link>
		<comments>http://sridharword.wordpress.com/2009/06/24/connect-mysql-database-from-java/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 07:39:13 +0000</pubDate>
		<dc:creator>sridharword</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sridharword.wordpress.com/?p=3</guid>
		<description><![CDATA[import java.sql.Connection; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; /** * @author Sridhar Srinivasan Jun 24, 2009 12:53:57 PM */ public class MySQLConnection { private static Connection getConnection(){ String driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;; String connectionUrl=&#8221;jdbc:mysql://localhost:3306/test&#8221;; String userName=&#8221;root&#8221;; String password=&#8221;mysql&#8221;; Driver driver = (Driver) getObject(driverClassName); Connection connection=null; try { DriverManager.registerDriver(driver); connection=DriverManager.getConnection(connectionUrl,userName,password); } catch (SQLException e) { e.printStackTrace(); } [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sridharword.wordpress.com&amp;blog=7115981&amp;post=3&amp;subd=sridharword&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>import java.sql.Connection;<br />
import java.sql.Driver;<br />
import java.sql.DriverManager;<br />
import java.sql.SQLException;<br />
import java.sql.Statement;</p>
<p>/**<br />
 * @author Sridhar Srinivasan<br />
   Jun 24, 2009 12:53:57 PM<br />
 */<br />
public class MySQLConnection {</p>
<p>	private static Connection getConnection(){<br />
		String driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;;<br />
		String connectionUrl=&#8221;jdbc:mysql://localhost:3306/test&#8221;;<br />
		String userName=&#8221;root&#8221;;<br />
		String password=&#8221;mysql&#8221;;<br />
		Driver driver = (Driver) getObject(driverClassName);<br />
		Connection connection=null;<br />
		try {<br />
			DriverManager.registerDriver(driver);<br />
			connection=DriverManager.getConnection(connectionUrl,userName,password);<br />
		} catch (SQLException e) {<br />
			e.printStackTrace();<br />
		}<br />
		return connection;<br />
	}</p>
<p>	public static void main(String[] args) {<br />
		Connection  connection = getConnection();<br />
		try {<br />
			Statement statement = connection.createStatement();<br />
			statement.executeUpdate(&#8220;DELETE FROM STUDENTS&#8221;);<br />
		} catch (SQLException e) {<br />
			e.printStackTrace();<br />
		}</p>
<p>	}</p>
<p>	public static Object getObject(String className){<br />
		Object object = null;<br />
		try {<br />
			object=Class.forName(className).newInstance();<br />
		} catch (InstantiationException e) {<br />
			e.printStackTrace();<br />
		} catch (IllegalAccessException e) {<br />
			e.printStackTrace();<br />
		} catch (ClassNotFoundException e) {<br />
			e.printStackTrace();<br />
		}<br />
		return object;<br />
	}<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sridharword.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sridharword.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sridharword.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sridharword.wordpress.com&amp;blog=7115981&amp;post=3&amp;subd=sridharword&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sridharword.wordpress.com/2009/06/24/connect-mysql-database-from-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9046078f744d1826134b537991aaf5fb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sridharword</media:title>
		</media:content>
	</item>
	</channel>
</rss>
