I want get data from ms access with my java app. java version 1.8. I watched video from youtube. there was these code:
public class Main {
public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:Test");
Statement st = conn.createStatement();
String sql = "Select * from playlist";
ResultSet rs = st.executeQuery(sql);
while(rs.next()) {
System.out.print(rs.getString(1));
}
} catch (Exception e){
System.out.print(e.getMessage());
}
}
}
my output is:
sun.jdbc.odbc.JdbcOdbcDriver
Process finished with exit code 0
what am i doing wrong? if there extras i have to do? please help!