hai
I am using windows 7 with 32 bit os
I installed java 1.6 version
I also installed oracle 10g.
When I am trying to execute
jdbc-odbc programs
it simply displays
"jdbc drivers not found"
plz help me
View Answers
February 18, 2011 at 3:44 PM
Java connect to MS Access database
If you want to connect MS Access database with the java code using driver "sun.jdbc.odbc.JdbcOdbcDriver", then follow these steps:
1)Go to the start->Control Panel->Administrative Tools-> data sources.
2)Click Add button and select the driver Microsoft Access Driver(*.mdb).
3)After selecting the driver, click finish button.
4)Then give Data Source Name and click ok button.
5)Your DSN will get created.
6) Restart your compiler and compile your java code.
Example:
import java.sql.*;
class RetrieveData{
public static void main(String[] args){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:student");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from data");
while(rs.next()){
System.out.println(rs.getString("name")+" "+rs.getString("address"));
}
}
catch(Exception e){
}
}
}
Ads
Related Tutorials/Questions & Answers:
hai
hai when we click on submit button request doesnot go to next servlet instead of that that servlet simply downloaded why?
can tell me plz
It seems that the problem lies in your code. Anyways, we are providing you
hai
hai I am using windows 7 with 32 bit os
I installed java 1.6 version
I also installed oracle 10g.
When I am trying to execute
jdbc-odbc programs
it simply displays
"jdbc drivers not found"
plz help me
Java
Advertisements
hai
hai
hai this is anitha ,
i am persuing my B.Tech. 3rd year,i am doing a mini project,my task is to develope a code in java,to generate a graph using sql database values.
so,kindly help me with my mini
ModuleNotFoundError: No module named 'hai'
ModuleNotFoundError: No module named '
hai' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
hai'
How to remove the ModuleNotFoundError: No module named '
hai' error
jdbc
jdbc
Hai ,
Give a steps for jdbc connectivity
hibernate query
hibernate query hibernate apache par kam karta
hai kya
Hi Friend,
Yes.
Thanks
jsp
jsp
hai please give me the table grid code code for jsp
length in array
length in array
hai
wat s length in array and where it s used
for loop
for loop
hai, I need to write java program to print numbers in "X" format
query optimization
query optimization
hai ! i need a code in java for database query optimization.plz help
SWING FRMES
SWING FRMES
hai SIR?
HOW TO DESIGN swing Frames
send source code
SWING FRMES
SWING FRMES
hai SIR?
HOW TO DESIGN swing Frames
send source code
multiple fields in hashtable
multiple fields in hashtable
Hai,could anyone help me to implement the object car fields speed,make & color in Hash table
coding for project
coding for project
hai
how to write jsp coding for project smart accessories ......
that s to navigate to another page when you click on a tag
How to Fetch Data using dropdown option
How to Fetch Data using dropdown option sir maine jsp pr ek login page banaya jismain branch ka option
hai.
main agar first dropdown main first... down main aa jati
hai jinke name se database main table
hai.
aise hi