Please help me to find out the problem with my code. I don't find exactly where the problem is. I am just trying to create a database connection and make a table. I am using MS Access.
import java.sql.*; /** * * @author Faysal */ public class dConnection { public dConnection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.accdb)}; DBQ=Data.accdb;"; Connection c = DriverManager.getConnection(database, "", ""); Statement st = c.createStatement(); String tName = "Student"; String cTable = "CREATE TABLE " + tName + "(id Integer, name Text(32), school Text(32), class Text(15), roll Text(10), " + "phone Text(20), address(32))"; st.execute(cTable); st.close(); c.close(); } catch(Exception e) { e.printStackTrace(); } } }