
hi..i want to create a table and insert data in that table of ms-access using java application i want to perform both operations of ms-access using jdbc connection

import java.sql.*;
public class CreateTable {
public static void main(String[] args) throws Exception {
Connection conn = DriverManager.getConnection("jdbc:odbc:student");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Statement st = conn.createStatement();
st.executeUpdate("create table employee (empid int,empname varchar(30));");
System.out.println("Table is created successfully!");
st.executeUpdate("insert into employee (empid,empname ) values (1,'Roseindia')");
System.out.println("Data is inserted successfully!");
st.close();
conn.close();
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.