jdbc
I compiling my jdbcodbc progrm. D:\Java\jdk1.6.0\bin>javac JdbcExample.java JdbcExample.java:12: cannot find symbol symbol : method ClassforName(java.lang.String) location: class JDBCExample ClassforName("sun.jdbc.odbc.JdbcOdbcDriver"); ^ I got this error.can any one tell me,why this error?
this is my code:
import java.sql.*;
import java.io.*;
import java.lang.String;
import java.sql.Connection;
import java.sql.DriverManager;
public class JdbcExample{
public static void main(String args[]){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(Exception e){
System.out.println(e);
}
try{
Connection con;
con=DriverManager.getConnection("jdbc:odbc:student");
System.out.println("Getting All Rows from a table!");
Statement st = con.createStatement();
ResultSet res = st.executeQuery("SELECT * FROM Table1");
System.out.println("student_code: " + "\t" + "student_name: ");
while (res.next()) {
int i = res.getInt("stud_code");
String s = res.getString("stud_name");
System.out.println(i + "\t\t" + s);
con.close();
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
View Answers
Related Tutorials/Questions & Answers:
JDBCJDBC why we use batch in
jdbc jdbcjdbc display the records using index in
jdbc Advertisements
jdbcjdbc Hai ,
Give a steps for
jdbc connectivity
JDBCJDBC How to add set of queries in a single query in
JDBC jdbcjdbc please tell me sir.i dont know
JDBC connection and how to create table in database
jdbc jdbc how to write program to save data and retrieve data from the form in Java
jdbcjdbc why do we need to load
jdbc drivers before connecting to database
JDBCJDBC how to set classpath for eclipse, java, where to copy
jdbc connector
JDBCJDBC in class.forname which driver name we are writing for the connection from
jdbc to sqlserver 2008
jdbcjdbc is it possible to use doget & dopost method with
jdbc to call in a servlet programe
JdbcJdbc A java program with
jdbc connectivity with insert,delete,update options for name,regno,mark1,mark2,total
JDBCJDBC can u send me the code of
jdbc how to join two tables that are in relation
JDBC - JDBCJDBC - limitations of jdbc What are the limitations of
JDBC jdbcjdbc define batch updates define batch updates?exp
JDBC... links:
http://www.roseindia.net/
jdbc/
Jdbc-batch-update.shtml
http://www.roseindia.net/tutorial/java/
jdbc/batchupdateresultsetexample.html
jdbcjdbc Write a web based student registration application where the
students can register online with their enrollment no. You are
required to use JSP, Servelet and
JDBC JDBCJDBC save a data in the database I need a code to save a data... between java and mysql using
JDBC and saves the data into the database.
import... con = null;
String url = "
jdbc:mysql://localhost:3306/";
String db
JDBCJDBC code to save a data in the database I need a code to save... the connection between java and mysql using
JDBC and saves the data into the database...!");
Connection con = null;
String url = "
jdbc:mysql://localhost:3306/";
String db
jdbchow can we set transaction level through
jdbc api how can we set transaction level through
jdbc api
Use Connection.setTransactionIsolation(int) to set the desired tansaction level, which takes one of the 5 arguments
jdbchow can we call stored procedure using jdbc how can we call stored procedure using
jdbc
Call a Stored Procedure using...();
For more information, visit the following link:
JDBC call Stored Procedure
jdbc - JDBCJava
JDBC application Database Application in Java
JDBC JDBC - JDBCJDBC Select Count Example Need an example of count in
JDBC JDBC - JDBCJDBC -statement types in jdbc statement types in
jdbc jdbc - JDBCLoading
JDBC driver at runtime How to load
JDBC Driver at runtime
jdbcjdbc hey sir i just wanna have some ppt on
jdbc coz have my exams next week and i have not attended any classes coz of job... I m studyng frm niit
jdbcjdbc I can't run my
jdbc program because it has error in this line:
public static void main(String[] args)
the error is:illegal static declaration in inner class
would you please let me whats the problem?
regards
jdbc using
jdbc connection
import java.sql.*;
public class CreateTable... = DriverManager.getConnection("
jdbc:odbc:student");
Class.forName
jdbcjdbc i had written
jdbc connection in method and i need to get connection in another class?
import java.sql.*;
class... driver = "com.mysql.jdbc.Driver";
String url = "
jdbc:mysql://localhost:3306/test
jdbc();
Connection conn = DriverManager.getConnection("
jdbc:mysql://localhost... information, visit the following link:
JDBC Tutorials
jdbchow can we set transaction level through
jdbc api how can we set transaction level through
jdbc api
Use Connection.setTransactionIsolation(int) to set the desired tansaction level, which takes one of the 5 arguments
jdbcjdbc how to update int values of ms-access in
jdbc program?
In MS Access database, use Number data type for int values.
import... =DriverManager.getConnection("
jdbc:odbc:access","","");
Statement st=null;
st
JDBCretrieve the value from database into dropdown list using
JDBC SQL 2005 How to retrieve the value from database into dropdown list using
JDBC &...").newInstance();
String connectionURL = "
jdbc:mysql://localhost:3306/test";;
Connection
JDBCJDBC write a
JDBC program to display the result of any query on a student table in a JTable component.
import java.awt....").newInstance();
Connection con = DriverManager.getConnection("
jdbc:mysql://localhost
jdbc the Connection.setTransactionIsolation(int level) method isolation level can be set in
JDBC. the method can
jdbcdefine transactions define transactions
Whenever a connection is created by using the
JDBC, then by default it is in auto- commit mode. This means that SQL statement will be automatically committed immediately after
jdbc oracle.jdbc.driver.OracleDriver());
Connection con=DriverManager.getConnection("
jdbc:oracle:thin
jdbc level can be set in
JDBC. the method can accept any of the arguments listed below
jdbc logical group of data with a number of columns.
JDBC ResultSet Example
Stored
jdbc);
}
try{
Connection con;
con=DriverManager.getConnection("
jdbc:odbc:student
JDBC = DriverManager.getConnection("
jdbc:mysql://localhost:3306/test", "root", "root
jdbcwhat are different type of locks what are different type of locks
Types of locks in
JDBC:
Row and Key Locks:: It is useful when updating the rows (update, insert or delete operations), as they increase concurrency
jdbc("
jdbc:odbc:student");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
jdbc - JDBCJDBC statement example in java Can anyone explain me ..what is statement in
JDBC with an example
jdbc = DriverManager.getConnection("
jdbc:mysql://localhost:3306/test", "root", "root
JDBC("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("
jdbc:mysql
jdbc - JDBCJDBC Query to Connect Database
JDBC Query to connect to database will u supply me the block of code where it throws the exception
jdbc - JDBC management so i need how i can connect the pgm to database by using
jdbc...? if u replyed its very useful for me... Hi,
Please read
JDBC tutorial at http://www.roseindia.net/
jdbc/
jdbc-mysql/
Thanks
Hi,
You
JDBC - JDBCJDBC What is mean
JDBC ANY E BOOK
Hi Friend,
Please visit the following link:
http://www.roseindia.net/
jdbc/
Hope that it will be helpful for you.
Thanks
JDBC - JDBCJDBC
JDBC driver class not found:com.mysql.jdbc.Driver.....
Am... path.
For read more information on
JDBC visit to :
http://www.roseindia.net/
jdbc/
jdbc-mysql/MysqlConnect.shtml
Thanks
JDBC - JDBCexplanation of
JDBC drivers Need tutorial on
JDBC driversThanks! Hello,There are four types of
JDBC drivers. There are mainly four type of
JDBC drivers available. They are:Type 1 :
JDBC-ODBC Bridge Driver A
JDBC-ODBC