jdbc warning regarding to ms access

jdbc warning regarding to ms access

shows warning msg while compiling using ms access : warning: sun.jdbc.odbc.JdbcOdbcDriver is Sun proprietary API and may be removed in future release.

here is my code

import java.sql.*;
class AccessData
{ public static void main(String args[])throws Exception
{ DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
Connection con=DriverManager.getConnection("jdbc:odbc:accdsn","","");
try{
Statement stmt=con.createStatement();
ResultSet rs= stmt.executeQuery("select * from tn");
while(rs.next())
{
System.out.println(rs.getInt(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
System.out.println(rs.getString(4));
}
}
catch(Exception e){}
}
}

View Answers

October 23, 2010 at 10:59 PM

Hi,

If you use the sun.jdbc.odbc.JdbcOdbcDriver, it will give you the warning.

You can suppress the warning using following code:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

But since this is proprietary API you go for the Type 4 JDBC driver.

You have following options:

a) Just visit JDBC-ODBC Bridge and download the driver for your database.

b) Use the Type for 4 Driver for your database.

Thanks









Related Tutorials/Questions & Answers:
jdbc warning regarding to ms access
jdbc warning regarding to ms access  shows warning msg while compiling using ms access : warning: sun.jdbc.odbc.JdbcOdbcDriver is Sun proprietary API...=DriverManager.getConnection("jdbc:odbc:accdsn","",""); try{ Statement stmt
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
Advertisements
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
MS Access - JDBC
information about MS access database...but still i am having doubt in that topic. My problem is : Is there any jar to connect MS Access and java ... because... to be remember 1.to configure the ms access database to your system control
MS ACCESS - JDBC
MS ACCESS  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'origin='src' destination='dest''. THAT MY PROBLEM
MS Access` - JDBC
MS Access`  Hello Sir, Thank you very much for your valuable information. Actually i am doin a project to generate Hall tickets.So, I need to insert image into MS Access Database. Now the task is how to retrieve the image
java &ms access - JDBC
for a food festival using Java swing as front end and MS access as Backend... ve managed to populate the JComboBox using MS Access. The problem is only 8 per... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
regarding ms acces database and servlet - JDBC
regarding ms acces database and servlet  hello there, i am trying to do a web application that makes use of a data base. I opted for ms access... optional configuration of ms access driver.... can any body tell me what
audio files in jdbc connectivity with ms-access - JDBC
audio files in jdbc connectivity with ms-access  i need to know how to retrieve audio files through jdbc connectivity with ms-access and how to play... static void main(String[] args) { try{ String url="jdbc:odbc:access"; File
regarding jdbc - JDBC
regarding jdbc  how i can configure java with ms access
ms access
ms access  how to delete the autonumber from ms access using java delete code
MS-Access
MS-Access  I am trying to upload a image to ms-acess using jsp,and my...: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect ".I think i set... = DriverManager.getConnection("jdbc:odbc:student"); File imgfile = new File("C:/rose.jpg
MS access
MS access  how do i access my Ms-Access file placed in the same jar file where my application code/class file r present??? Want to access it via Code. Can anyone help me ? Please give reply urgent...   give me reply
How to Access MS Access in jar.
to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen...How to Access MS Access in jar.  how do i access my Ms-Access file
Ms Access
Ms Access   How to get query for Primary key from MsAccess?   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name = 'data';   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb...MS ACCESS  i have done : Insert form data into MS database...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb...MS ACCESS  i have done : Insert form data into MS database...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb...MS ACCESS  i have done : Insert form data into MS database Follow...-> data sources. 2)Click Add button and select the driver Microsoft Access
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
regarding java - JDBC
will be directly saved in the database i have seen many examples regarding this concept on java with ms access on the site www.planetsourcecode.com can you...regarding java  i am making a project on supply chain system i have
MS Access - JSP-Servlet
stepts 1.to configure the ms access database to your system control panel... in Connectivity in MS Access : import java.sql.*; public class...MS Access  hello sir, i want to use MS.Access as my database..so my
inserting picture in ms access
inserting picture in ms access  hi i am sanatan, how to insert picture in ms access by jsp.   <%@page import="java.sql.*,java.io.*"%>..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
regarding jdbc - JDBC
regarding jdbc  i am using this program /* import java.sql....").newInstance(); con = DriverManager.getConnection("jdbc:mysql:///test... the following error Exception: Access denied for user 'root'@'localhost' (using
MS Access` - IDE Questions
MS Access`  hello sir, how to configure MS Access database in Net Beans5.5... and i have a doubt, where should we run the below code...either in IDE or in any editor like EDITPLUS. waitin for your reply.... thank you
J2ME connectivity to ms access
J2ME connectivity to ms access  How to establish client server connectivity to access ms access database on the server side? I have made the odbc connection. Plz help me in the coding part.. Dont know how to start
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
regarding jdbc - JDBC
regarding jdbc  is there any way in jdbc to retieve data from a table and show it by using swing concept i mean to say data from the table can be shown in swing interface with tabular form
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
Query regarding JSP, JDBC
Query regarding JSP, JDBC  can I get the code for the question asked by me regarding JSP,JDBC
excel to ms access
excel to ms access  hello sir i am developing a application which requires extracting data from excel sheet and place in the ms access database using java programming for example: in excel sheet i have 2 columns and more than
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.  please provide online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.   Create table test
regarding jdbc - JDBC
regarding jdbc  how to connect mysql with java example you have provided is having some error and i am not able to remove that error please... = DriverManager.getConnection("jdbc:mysql://localhost:3306/yourdatabase", "your username", "your
MS Access - WebSevices
MS Access  hello sir, i am trying to write a code which should take images from a particular folder and data from MSAccess..please help me..thank..." which have access database and for images we have created a field in the table
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
Dialect for MS Access - Hibernate
Dialect for MS Access  Can someone tell the Dialect for MSAccess.I need it urgently Thanks in advance
Upload file to MS Access
Upload file to MS Access  Iam beginner and need to upload file to msaccess using jsp . Iam using netbeans platform. Kindly explain do I need to mention Attachment format in the table
Migrating from mysql to MS Access
Migrating from mysql to MS Access  Hi I am hoping for some help I need to write a conversion program (SQL statements) to import existing data in a MYSQL database to a MS Access database. any suggestions would be appreciated
How to use JTable with MS-Access
(MS-Access). 1. Name 2. City 3. Contact I want to Display....   Here is an example that retrieves the data from MS Access database... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from data"; Statement
How to use JTable with MS-Access
(MS-Access). 1. Name 2. City 3. Contact I want to Display....   Here is an example that retrieves the data from MS Access database... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from data"; Statement
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v...("jdbc:odbc:st") Can u pls help us in solving this pbm by giving whole source... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
MS-ACCESS Query Problem - SQL
MS-ACCESS Query Problem  hi sir i have table which is initially have empty records Deleted Attributes: Roll Name Add Age Course Class... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
accessing ms access through jsp
accessing ms access through jsp  i have 3 tables in my database employee,project,task if i put employee id the search field .i should get details from other table what all queries should i use in servlet file and i am using
regarding JTable - JDBC
regarding JTable  how to populate a JTable with mysql data after clicking JButton please explain with the example
Accessing Ms access data in JAVA GUI Envi.
Accessing Ms access data in JAVA GUI Envi.  Q.How to insert data into ms access data in java using swing ? Q.How to slove (access denided ("java.lang.RuntimePermission" "accessClassInPackage.sun.jdbc.odbc")" these exception
JDBC with access as backend
JDBC with access as backend  Jdbc connectivity in java to MS Access... data between two dates from MS access database. import java.sql.*; class... con = DriverManager.getConnection("jdbc:odbc:roseindia"); Statement st

Ads