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 7186503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:38:42+00:00 2026-05-28T18:38:42+00:00

My code for connection with access database is this…its working fine here… i have

  • 0

My code for connection with access database is this…its working fine here… i have tried to connect my database with java derby embedded database but always getting sql exception assuming the same table what changes do i need to connect my application with java derby embedded database??

 package database;
    import java.sql.*;
    import javax.swing.JOptionPane;

       public class database {

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {

            try
            {
                String url = "jdbc:odbc:personnew";
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection con=DriverManager.getConnection(url);
            Statement st=con.createStatement();
            String sql="SELECT * FROM Person";
            ResultSet rs=st.executeQuery(sql);
            while(rs.next()){
            String id=rs.getString("id");
            String name=rs.getString("name");
            String fathername=rs.getString("fathername");
            JOptionPane.showMessageDialog(null,id+"\t"+name+"\t"+fathername);
            }
            // TODO code application logic here
        }catch(Exception sqlEx){
            System.out.println("Sql exception");
        }
    }
    }
  • 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-28T18:38:43+00:00Added an answer on May 28, 2026 at 6:38 pm

    For one thing, You would need to use the correct JDBC driver; org.apache.derby.jdbc.EmbeddedDriver

    http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html

    The tutorial in general is probably where you want to start as it tells you everything you need to know:

    http://db.apache.org/derby/papers/DerbyTut/index.html

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

Sidebar

Related Questions

I have a whole slew of database access functions which assume a particular connection
Here is my code: Dim connectionString As String =Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\ACCESS DATABASE\search.mdb Dim selectCommand As
With the following code below I have managed to open an Access.mpd database and
I have this Access database that we use to run reports. The report is
ms-access is connecting to a local mysql database the following code returns an error:
In my code behind page, how do I access the connection string which is
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
currently i have jdbc code with the following basic stucture: get Connection (do the
This code runs on my local RoR/Windows 7 (64-bit): sql = ActiveRecord::Base.connection() last_pk =
I need to export data into an Access database. My code works, but it

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.