JDBC ODBC related problem

JDBC ODBC related problem

i WANT HELP RELATED TO JDBC CONNECTIVITY WITH MS ACCESS.. HERE IS MY FULL CODE... import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemListener; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import javax.swing.*; public abstract class New_Customer extends JFrame implements ActionListener,ItemListner { JTextField textFieldId; JTextField textFieldName; JTextField textFieldContactNo;
JLabel l1; JLabel l2; JLabel l3; JLabel l4; JLabel l5; JLabel l6;
JComboBox combo; ComboBox b = new ComboBox(); String course[] = {"Navakal","SandhyaKal","Pudhari","MidDay","Inqlab","BusinessLine","Mumbai Samachar","Gujraj Samachar","Karnatak Malla","Vartahar","PunyaNagari"};
JButton b1; JButton b2; PreparedStatement ps; Container c = getContentPane(); New_Customer() { super("Shree DattaDigambar Samarth"); setBounds(140,250,777,555); c.setLayout(null); textFieldId = new JTextField(); textFieldName = new JTextField(); textFieldContactNo = new JTextField(); l1 = new JLabel("New Customer Entry"); l2 = new JLabel("Building No"); l3 = new JLabel("Customer Name"); l4 = new JLabel("Contact No"); l5 = new JLabel("Paper");
combo = new JComboBox(course); l1.setBounds(10,10,340,20); l2.setBounds(10,20,140,70); l3.setBounds(110,20,140,70); l4.setBounds(300,50,140,20); l5.setBounds(400,50,140,20); textFieldId.setBounds(10,70,70,20); textFieldName.setBounds(110,70,180,20); textFieldContactNo.setBounds(300,70,90,20); combo.setBounds(400,70,130,20); b1 = new JButton("Add paper"); b2 = new JButton("Ok"); b1.setBounds(10,100,100,20); b2.setBounds(10,160,50,20);
c.add(combo);
c.add(b1); c.add(b2); c.add(l1); c.add(l2); c.add(l3); c.add(l4); c.add(l5); c.add(textFieldId); c.add(textFieldName); c.add(textFieldContactNo);
setVisible(true); setDefaultCloseOperation(EXITONCLOSE);
b1.addActionListener(this); b2.addActionListener(this); combo.addItemListener(null);

    }
    public void actionPerformed(ActionEvent ae)
    {
        if(ae.getSource()==b2)
        {
            try
            {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection con;
                con = DriverManager.getConnection("jdbc:odbc:Digambar_Dalvi");
                ps=con.prepareStatement("insert into Customer(Building_No,Customer_Name,Contact_No,Paper_Name)values(?,?,?,?)");


            ps.setString(1,textFieldId.getText());
            ps.setString(2,textFieldName.getText());
            ps.setString(3,textFieldContactNo.getText());                           
            ERROR{                String str = (String)combo.getSelectedItem();
            ERROR           ps.setString(4,combo.getText());
            ERROR           //ps.setString(4,str.getText());
            ERROR           ps.executeUpdate();
                }
                con.close();  

            }
            catch(Exception ex)
        {
            System.out.println("Error 1:"+ex);
        }
        }
    }
    public static void main(String args[])
{

    New_Customer v = new New_Customer() {};



}

}

AS I SHOW IN CODE THE ERROR PART...... THE QUESTION N PROBLEM IS I WANT TO SELECTE PERTICULAR PAPER FROM COMBOBOX AND THOSE SELECTED PAPER TEXT I WANT TO PRINT IN MS ACESS DATABASE..MEANS FROM THAT I COME TO KNOW THAT WHICH CUSTOMER HAVING WHICH PAPER........... HELP ME PLZ THANKS IN ADVANCED

View Answers









Related Tutorials/Questions & Answers:
JDBC ODBC related problem
JDBC ODBC related problem  i WANT HELP RELATED TO JDBC CONNECTIVITY... con; con = DriverManager.getConnection("jdbc:odbc:Digambar... THE ERROR PART...... THE QUESTION N PROBLEM IS I WANT TO SELECTE PERTICULAR PAPER FROM
JDBC related Problem - JDBC
JDBC related Problem  Hey plz check out the following code... = "jdbc:odbc:" + ds; try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver...("jdbc:odbc:access"); Statement st = con.createStatement(); int c
Advertisements
jdbc odbc
= DriverManager.getConnection("jdbc:odbc:swing"); String sql = "INSERT...jdbc odbc  Sir, i want to get the selected value from JCombobox to ms... problem. you can read this complete tutorial from the link given below http
jdbc odbc
jdbc odbc   i have two tables in database 1table's attribute is foreign key of another in this case how to retrive value from both table and show in a gridview combine using java code   Sql query to retrieve values
JDBC-ODBC
JDBC-ODBC  HI what should i give names for DNS and TNS in Administrative Tools so that there will be connection between Database (oracle) and java.Actually how to operate Administrative Tools
JDBC-ODBC
JDBC-ODBC  HI what should i give names for DNS and TNS in Administrative Tools so that there will be connection between Database (oracle) and java.Actually how to operate Administrative Tools
jdbc odbc
jdbc odbc  i want to fetch the data from the ms access and print on ms word for printing purpose?? the whole program is in swing to ms acess connectivity.. the whole set up is perform only printing part is remaining? so help me
jdbc odbc
jdbc odbc  i want to fetch the data from the ms access and print on ms word for printing purpose?? the whole program is in swing to ms acess connectivity.. the whole set up is perform only printing part is remaining? so help me
The JDBC-ODBC Bridge.
The JDBC-ODBC Bridge.  Are there any ODBC drivers that do not work with the JDBC-ODBC Bridge
Java Jdbc-odbc
Java Jdbc-odbc  What is the difference between JDBC and ODBC
Java JDBC ODBC
Java JDBC ODBC  What is the difference between JDBC and ODBC
jdbc odbc connection
jdbc odbc connection  i need a program in java which uses a jdbc odbc... computer and then access in your Java program.ADS_TO_REPLACE_1 Read the JDBC ODBC..._TO_REPLACE_2 Example of JDBC ODBC bridge. Thanks
What is ODBC - JDBC
What is ODBC  What is Java ODBC and JDBC?   Method of type.... | JDBC Driver | ODBC Driver
JDBC-ODBC Bridge multi-threaded.
JDBC-ODBC Bridge multi-threaded.  Is the JDBC-ODBC Bridge multi-threaded
problem related to onSubmit() method
problem related to onSubmit() method  Hello, I am developing application.when i submit form at that time formBacking() method is call...Instead of that onSubmit() should have to call .... please help me
JDBC-Odbc Connection
JDBC-ODBC Connection       JDBC-ODBC Connection is a JDBC driver that translates the operation in  JDBC into ODBC. For ODBC,it is a normal java application program. This bridge
jdbc,odbc,MySQL,swing - Java Beginners
jdbc,odbc,MySQL,swing  write a code that displays a menu list of all... from this list and execute any query (within a text field)related to the selected database driver.It is very well known as jdbc front end of a database
jdbc odbc sql server exception
jdbc odbc sql server exception  Hi, I am trying to use sql server with java jdbc odbc but I am getting this exception java.sql.SQLException: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '@P1
jdbc & sql related project - JDBC
jdbc & sql related project  code using jdbc,odbc,swing,MySql classes to create front-end of any jdbc that allows the user to select any database... to execute any query related to student database i.e. the odbc driver should support
code related problem
code related problem  this code is compiling but not running please help import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Mybutton11 extends JFrame { JTextField text1 = new JTextField(20
JDBC ODBC Connection In Java
JDBC ODBC Connection In Java In this section we will read about the various aspects of JDBC ODBC such as, JDBC-ODBC bridge, JDBC ODBC connection, how to create DSN etc. JDBC-ODBC Bridge As its name JDBC-ODBC bridge, it acts like
JDBC-Odbc Connectivity
JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC...;static private final String connection = "jdbc:odbc
JDBC related query
JDBC related query  How to merge two resultset of two different queries, wherein both the resultset(after query execution)gives an integer value as its column
jdbc problem
jdbc problem   hi my name is mohit...i am making a project in java swings....pls help me how to check that the username and password are correct..."); con = DriverManager.getConnection("jdbc:odbc:mohit"); stmt
how to set fetch size for jdbc odbc driver
how to set fetch size for jdbc odbc driver  What is the default fetch size for the JDBC ODBC driver and how can i fetch a set of results for JDBC ODBC driver?   Fetching results JDBC ODBC Driver A. The default fetch
query related to jdbc
query related to jdbc  hello, i have done my database connection successfully ie db2 with RAD. but while running my application i am not able to fetch the data so please suggest and help me
Connect to MS Acces wothout using ODBC but JDBC - JDBC
Connect to MS Acces wothout using ODBC but JDBC  Hi, I want to connect my MS Access using JDBC but not ODBC. Please help me out. Thanks
start debugging problems related to the JDBC API
start debugging problems related to the JDBC API  How do I start debugging problems related to the JDBC API
Servlet problem - JDBC
but however. It gives problem sometimes while at others it works perfectly. I m using jdbc-odbc driver. Can anybody help me plzzzz!!!!   Hi Friend
dsn problem - JDBC
to remember to create dsn (jdbc): 1.Create an ODBC DSN Using the Windows... of the Class class. forName() takes one string parameter JDBC-ODBC Bridge...: String url= "jdbc:odbc:myDSN"; // 5.Connection connection
Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method for the DatabaseMetaData Objects.
Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method for the DatabaseMetaData Objects.  Is there a way to find the primary key(s) for an Access Database table? Sun's JDBC-ODBC driver does not implement
problem in jdbc connection
problem in jdbc connection  when i am trying to insert into apache derby databse using java in netbeans an exceprion is thrown at run time like this:- java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver....what
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
LOGIN PROBLEM - JDBC
=?scott?, password = ?tiger?; String connectionURL = "jdbc:odbc:test...LOGIN PROBLEM   sir iam harikrishna studying B.Tech Fourth year sir... and passowrd then my problem is how can we write the code for validating the userid
Connection using Jdbc-odbc bridge Driver
Connection using JDBC-ODBC bridge driver JDBCExample.java..."); con=DriverManager.getConnection("jdbc:odbc:datastud");  ... program, Jdbc-Odbc bridge driver create connection between java application
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to [email protected]
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
java programming problem - JDBC
java programming problem  Hi, Request you to provide a solution ( analysis & design & unit test plan & code & test criteria ) to the following problem to the following mail id : Problem : upload excel file data into oracle
Sequence generator problem - JDBC
,but problem is that when i insert a values it will work and inserted the values.this one i am showing in a table ,but problem is a that it is also created a new
mysql problem - JDBC
= "jdbc:mysql://localhost:3306/test"; Connection con=null; try
mysql problem - JDBC
mysql problem   hai friends i have some problem with image storing in mysql. i.e while i am using image(blob) for insert the image it says out of bound of size error. please provide the logic for storing normal maxi size
How to Retrieve Excel data into mysql using type 2 JDBC-ODBC driver
How to Retrieve Excel data into mysql using type 2 JDBC-ODBC driver  Can any please help it is very urgent. I tried to read excel sheet using ODBC..."); Connection conn = DriverManager.getConnection("jdbc:odbc:excel
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
Problem to get connection from DAO class to JDBC
Problem to get connection from DAO class to JDBC  package controller; import java.sql.Connection; import java.sql.DriverManager; public class... { String DRIVER="oracle.jdbc.driver.OracleDriver"; String URL="jdbc:oracle
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL... ODBC program,bt here I am getting error i.e Exception in Thread "main
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL... ODBC program,bt here I am getting error i.e Exception in Thread "main
ODBC connection
ODBC connection   import java.sql.*; import java.util.*; public...)c.newInstance(); String s="jdbc:oracle:thin:@localhost:1521:ORCL... ODBC program,bt here I am getting error i.e Exception in Thread "main
odbc - Java Beginners
What is odbc connection  What is odbc connection
Product Components of JDBC
. The JDBC Driver Manager. 3. The JDBC Test Suite. 4. The JDBC-ODBC Bridge.ADS... of  Java Platform Enterprise Edition (J2EE).  4. The JDBC-ODBC Bridge. The JDBC-ODBC bridge, also known as JDBC type 1 driver is a 

Ads