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



Home Answers Viewqa JDBC JDBC ODBC related problem
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Devendra
JDBC ODBC related problem
0 Answer(s)      2 years ago
Posted in : JDBC


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


Advertisement
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. Read the JDBC ODBC example. Thanks   Here is another example with explanation: Example of JDBC ODBC
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
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 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,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 Connectivity
JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC...;"jdbc:odbc:emp";   public 
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
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 & 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
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
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
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
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
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
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
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
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
Connection using Jdbc-odbc bridge Driver
Connection using JDBC-ODBC bridge driver JDBCExample.java..."); con=DriverManager.getConnection("jdbc:odbc:datastud");  ...;} } Output Description of Program In the above program, Jdbc-Odbc
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
 

 

 

DMCA.com