Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners java servlet connectivity problem with access

Have Programming Question? Ask it here!
 
 
 


meer
java servlet connectivity problem with access
1 Answer(s)      a year and 3 months ago
Posted in : Java Beginners


Import java.sql
javax.servlet

//all packages entered
try {
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:CUSTOMER");
           Statement st=con.createStatement();
// Execute an SQL query, get a ResultSet
ResultSet  rs = st.executeQuery("SELECT NAME, ADDRESS FROM CUSTOMER");
// Display the result set as a list
}
catch(.......){}

ERROR MSG on cmd


DBPhoneLookup.java:26: incompatible types
found   : java.sql.Connection
required: Connection
           Connection con = DriverManager.getConnection("jdbc:odbc:CUSTOMER");
                                                       ^
DBPhoneLookup.java:27: cannot find symbol
symbol  : method createStatement()
location: class Connection
           Statement st=con.createStatement();
                           ^

i am confused what is the problem with this part of code

Advertisement
View Answers

January 28, 2013 at 12:07 PM


hi friend,

I think you should check the line of importing package of sql probably there may be a problem. Java is a case sensitive language. In your sample code I can see that you have used the Import java.sql instead of

import java.sql.Connection;

if the problem is not occurred due to the above reason probably there may be a problem in naming of a class. Check whether you have created a class by name "Connection" in your package

for detail tutorial you can go through the link Database Connectivity in Servlet



Related Tutorials/Questions & Answers:
java servlet connectivity problem with access
java servlet connectivity problem with access  Import java.sql javax.servlet //all packages entered try { Class.forName...=con.createStatement(); ^ i am confused what is the problem
connectivity with access
connectivity with access  how to connect with data base with access...; Is this Access database or excel sheet. Do you want to display the values...;Is this Access database or excel sheet. Do you want to display the values in Textarea
Advertisements
connectivity problem
connectivity problem  i am facing error in Class.for name statement... connectivity still i am facing this error* ================================oracle connectivity program============================ import java.sql.*; import
Java servlet sql connectivity error - JSP-Servlet
Java servlet sql connectivity error  Hi, I have been trying to connect to sql database via the servlet program in java.I have not been successful so far. However when i try to connect to sql through a normal java program
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
Access 2007 database connectivity
source and destination. pls tell me the code of connectivity with access 2007...Access 2007 database connectivity  i design an application form that have two JComboBox as the label(source,destination) and two JButton save
**Connectivity is not getting done in this program plz check it out wat is the problem with that Although i've made tables in MA-ACCESS**
**Connectivity is not getting done in this program plz check it out wat is the problem with that Although i've made tables in MA-ACCESS**  <p>...; data sources. 2)Click Add button and select the driver Microsoft Access Driver
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle.... for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle... of simple connectivity with oracle in this I am giving driver details
Java Servlet Problem - JSP-Servlet
Java Servlet Problem  I have a servlet class that implemets..., but in the attributeReplaced() method, i want to perform a redirect to another servlet... method. Please help!!  Hi friend, Please explain problem
database connectivity problem
database connectivity problem  what if client dont have database with them then what is other way to run successfully our programm   Please visit the following link: http://www.roseindia.net/jdbc
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
Problem with JRadioButton and Access Database - Java Beginners
Problem with JRadioButton and Access Database  Hello sir ,Here I have write following code to save text on JradioButton but this is not saved in Access Databse, I want to store course type in to database and also other fields
Java Problem - JSP-Servlet
Java Problem  What are the steps to run a java Servlet program.with examples  Hi Friend, Please visit the following link: http://www.roseindia.net/servlets/index.shtml Thanks
Java Problem - JSP-Servlet
Java Problem  How to run a Simple JSP program ? what steps are necessary  Hi Friend, Steps: 1)First of all you need to install Tomcat on your system. 2)Then put your tomcat folder inside the C drive. 3)Set
java connectivity
java connectivity  hi........ Can u help me to do connectivity between java and weka??????? weka is a data mining tool which allows to do prediction, classification etc.... i want to do connectivity between weka and java can u
Java connectivity with MySQL
Java connectivity with MySQL  Java connectivity with MySQL
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
java connectivity
java connectivity  i am trying to add dyanamic rows in the jsp page, when i add the new row the dropdown control value is not coming from database..please help me to overcome this problem
Servlet compilation problem - Java Beginners
Servlet compilation problem  hi, m a beginner to servlet world... i m facing problem in servlet compilation problem.. i have set the classpath of servlet-api.jar . m using tomcat 6.0 i m unable to compile my servlet program
servlet program problem - Java Beginners
servlet program problem   i used ur servlet example prg with xml file of helloworld program and i run dat program in tomcat, it shows only... file to run it  Hi Friend, Please clarify your problem. Thanks
how to solve this problem for oracle connectivity
how to solve this problem for oracle connectivity  Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap ter could not establish the connection
java validation problem - JSP-Servlet
java validation problem  I have created a Registration page.I want... to do this? Can anyone gives the answer for this problem? Thanks in advance... problem. Here is the link http://www.roseindia.net/jsp/user-registration-form
Problem with Double type Value in Access Database - Java Beginners
Problem with Double type Value in Access Database  Hello sir I have store Double Type Value in MS Access Databse,but when I search Record... Mobile Number with MS access Database,plz Help Me Sir.   Hi Friend
Servlet Problem - Java Interview Questions
Servlet Problem  I need to get an alert message when the submit button is clicked again while processing... how is it possible...?? Thanks in advance
connectivity - JSP-Servlet
connectivity  hi, im doing a project in bioinformatics.I wish to create a webserver,for that I have to access the datas from a databse file named ProteinDataBank which is already available.I want to know the coding for how
MS Access - JSP-Servlet
in Connectivity in MS Access : import java.sql.*; public class... problem is how to connect MS Acces database with servlets ... thank you...   hai i m kaleeswaran ihave some idea to connect msaccess to servlet
sql connectivity through java
sql connectivity through java  i want an example for java db through sql connection. Thanks in advance
Database connectivity with jsp code - JSP-Servlet
Database connectivity with jsp code  I have written a program in java having connectivity with online_exam. Its working properly. Connection has been established and the code in java is showing the output. But the problem
Servlet problem
connectivity code it works but problem is with servlet page. My servlet code...Servlet problem  Hello, I am very shocked about this mysterious problem from last three month and now i hope rose india developers
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  ... Database But i m still not able to open this picture through Java using M.S. Access and i wants to open this Picture On Web Browser using Java Servlet anybody can
servlet problem
servlet problem  wheni m deploying an servlet application im getting trouble context [/filename] startup failed due to previous error in tomcat 6.0.
Java to SQL Server Connectivity
Java to SQL Server Connectivity  Hi, heres my code private void... with sql server connectivity at the background to save the data. Now, after... the connectivity wrong. Kindly help me resolve this issue ASAP. Thank you
JDBC, Java Database Connectivity
tutorials. Java Database Connectivity or JDBC for short is Java bases API... driver as per your application needs. About JDBC Java Database Connectivity... in developing Java programs that access the database are mentioned below
Servlet and Access - JDBC
Servlet and Access  How to use RequestDispatcher in servlet to call.... And how to save image in access database cause i am using Microsoft access 2003 so how to save the image file in access Database. please do reply
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting... the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver, click
Java Script Code Problem - JSP-Servlet
Java Script Code Problem  how to concatenate html table values(there are 3 rows,each row contains 3 fields) into variable and display it using javascript  Hi Friend, Try the following code: document.write
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
database connectivity in java - JDBC
database connectivity in java  import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.sql.*; class Project implements ActionListener { JFrame f; JPanel p1,p2,p3; JTabbedPane
Java database connectivity
Java database connectivity  Hi sir I need a code to create an application where user enter name in text box and that should be stored in database. Plz help me out its very urgent.   import java.sql.*; import java.awt.
Servlet Problem - JSP-Servlet
Servlet Problem  Hii I am Ajay . I am makin g a project in java using servlets. I have a database in which I have stored images along with some other info(Name, address type). I want to display that info in text form along
problem running a servlet on tomcat.
problem running a servlet on tomcat.  i have followed the steps given... to run my servlet that is placed in the directories as it has been mentioned here, the browser responds "HTTP Status 404 - /java_mail/hello" wht could
problem in servlet program
problem in servlet program  Dear Sir, I have a problem to insert the Blob type data like as video file, audio file in the database using Servlet and html code
problem of static in jsp page by multiple user access
problem of static in jsp page by multiple user access  hi , i am continuing my online exam project,but i have a Singleton class which i am invoking from my jsp page , ths page can access by more number of users .every user
connectivity
connectivity  sir i have created a web page for login form and i have also created the related data base in both ms access and oracle 10g now how to store those values in form to databases can u plz hlp me
DataBase connectivity in java with Microsoft sql server2000 - JDBC
DataBase connectivity in java with Microsoft sql server2000  How i can achieve database connectivity with Microsoft sql server2000 in my java source code
connectivity
connectivity  how to connect java with database
Problem insert data into database using servlet n javabean - Java Beginners
Problem insert data into database using servlet n javabean  I created a servlet for registration proses I got a problem compiling my servlet... to solve it.. i really new in jsp+servlet+javabean,dont really unnderstand 1)my
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms... is fired through a button .Now problem is at text fields are getting data from
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms... is fired through a button .Now problem is at text fields are getting data from
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms... is fired through a button .Now problem is at text fields are getting data from
 

 

 

DMCA.com