Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6964873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:58:48+00:00 2026-05-27T15:58:48+00:00

I’m learning databases using Java, and here is the simple code for that: import

  • 0

I’m learning databases using Java, and here is the simple code for that:

import java.awt.BorderLayout;

import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;


public class ClassGUIApplication extends JFrame{

private JPanel centerPnl = new JPanel();
private JPanel northPnl = new JPanel();
private JLabel idLbl = new JLabel("Id:");
private JLabel nameLbl = new JLabel("Name:");
private JLabel surnameLbl = new JLabel("Surname:");
private JLabel gradeLbl = new JLabel("Grade:");
private JTextField idTxt = new JTextField(30);
private JTextField nameTxt = new JTextField(30);
private JTextField surnameTxt = new JTextField(30);
private JTextField gradeTxt = new JTextField(30);
private JButton insertBtn = new JButton("INSERT");
private JTable table;
private StudentDBManager mng = new StudentDBManager();
private ClassTableModel model;
public ClassGUIApplication() {
    setTitle("Class Grade Report");
    setLayout(new GridLayout(2,1));
    centerPnl.setLayout(new GridBagLayout());
    GridBagConstraints gc = new GridBagConstraints();
    gc.gridx = 0;
    gc.gridy = 0;
    centerPnl.add(idLbl, gc);
    gc.gridx = 1;
    gc.gridy = 0;
    centerPnl.add(idTxt, gc);
    gc.gridx = 0;
    gc.gridy = 1;
    centerPnl.add(nameLbl, gc);
    gc.gridx = 1;
    gc.gridy = 1;
    centerPnl.add(nameTxt, gc);
    gc.gridx = 0;
    gc.gridy = 2;
    centerPnl.add(surnameLbl, gc);
    gc.gridx = 1;
    gc.gridy = 2;
    centerPnl.add(surnameTxt, gc);
    gc.gridx = 0;
    gc.gridy = 3;
    centerPnl.add(gradeLbl, gc);
    gc.gridx = 1;
    gc.gridy = 3;
    centerPnl.add(gradeTxt, gc);
    gc.gridx = 2;
    gc.gridy = 4;
    centerPnl.add(insertBtn, gc);
    insertBtn.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            int id = Integer.parseInt(idTxt.getText());
            String name = nameTxt.getText();
            String surname = surnameTxt.getText();
            double grade = Double.parseDouble(gradeTxt.getText());
            Student student = new Student(id,name,surname,grade);
            mng.addStudent(student);
            List<Student> classList = mng.getStudents();
            model = new ClassTableModel(classList);
            table.setModel(model);

        }
    });

    northPnl.setLayout(new GridLayout());
    List<Student> classList = mng.getStudents();
    model = new ClassTableModel(classList);
    table = new JTable(model);
    northPnl.add(new JScrollPane(table));

    add(centerPnl);
    add(northPnl);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setPreferredSize(new Dimension(500,500));
    setVisible(true);
    pack();
}

public static void main(String[] args) {
    ClassGUIApplication app = new ClassGUIApplication();
}


}


public static void main(String[] args) {
    ClassGUIApplication app = new ClassGUIApplication();
}


}

Eclipse gives eror like this:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at StudentDBManager.openConnection(StudentDBManager.java:21)
    at StudentDBManager.(StudentDBManager.java:15)
    at ClassGUIApplication.(ClassGUIApplication.java:36)
    at ClassGUIApplication.main(ClassGUIApplication.java:102)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:58:49+00:00Added an answer on May 27, 2026 at 3:58 pm

    Are your operating system or JVM 32 bit or 64 bit?

    I don’t believe the 64 bit JVM has the ODBC bridge driver class. And a 64 bit operating system would suggest that you should read this:

    http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/1c63e3ae-e001-4066-9eac-ad9162116603

    Whenever I get an error, the first thing I do is paste it into Google. I usually learn that I’m not the first person to see my problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.