File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes basic JDBC application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "basic JDBC application" Watch "basic JDBC application" New topic
Author

basic JDBC application

Karan Raj
Greenhorn

Joined: Jan 27, 2004
Posts: 16
Hi,

i wanna develope applications, by which i can connect to databases and excute queries.Can anybody suggest me..the best way so that i can start developing applications quickly using JDBC...i am new to java...please help me.

thanks,
karan
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8997
    
    9

The Java Tutorial: JDBC Database Access


[How To Ask Questions On JavaRanch]
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 861
Download the WAR at http://www.fdsapi.com to see examples of displaying dynamic data via jdbc. The live web demo is the same as the WAR you can download.


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
Nikhilesh Gandhi
Greenhorn

Joined: Feb 07, 2004
Posts: 8
use this code but first create a datasource using control panel /jdbcodbc
and select configure after selecting the required DB.
Create a table using the name in the coce or adjust to your requirements
import java.sql.*;
class temp
{

public static void main(String args[])
{
Connection conn;
Statement stat;
ResultSet rs;

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc dbc:Friend");
stat = conn.createStatement();
rs = conn.createStatement().executeQuery("select * from Friend");

while(rs.next())
{
System.out.println(rs.getString(1)+" "+rs.getString(2));
}
String Name="linus",Phone="6360073";

//String Query="insert into Friend values ('Mihir','455747')";
String Query="insert into Friend Values ('" +Name+ "','" +Phone+ "')";
stat.executeUpdate(Query);
conn.close();
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: basic JDBC application