Using AWS, PGADMIN, ECLIPSE, I need to add a new student to a database table using a java method, programming homework help

User Generated

jngreubhfrw1

Programming

Description

See assignment attached.

1.Create a Java Project in Eclipse and set up the JDBC Driver.

2.Create the class in the lab to access the DB via JDBC.

3.Add a method to the class to insert a new student with the following attributes. This method should take all columns in as parameters: 98999, Charlie, Comp Sci., 12

4.Create a Java class that takes a command line parameter to delete a student

5.Create a class that write out the contents of the Instructor table to a comma separated file.

Unformatted Attachment Preview

These might be helpful: http://db-book.com/ - where the database table examples came from CSC 1. Create a Java Project in Eclipse and set up the JDBC Driver. import java.sql.*; public class maindb { public static void main(String[] args) { Connection conn; Statement stat; ResultSet rs; String connectionURL = "csc540.cg3nl8ebpfzx.us-east1.rds.amazonaws.com"; String port = "5432"; String dbName ="csc540"; String userName = "csc540user"; String password = "password"; String jdbcUrl = "jdbc:postgresql://" + connectionURL + ":" + port + "/" + dbName + "?user=" + userName + "&password=" + password; try{ Class.forName("org.postgresql.Driver").newInstance(); conn = DriverManager.getConnection(jdbcUrl); stat = conn.createStatement(); stat.executeQuery("select * from student"); System.out.println("I made it"); } catch (Exception e) { } } } 2. Create the class in the lab to access the DB via JDBC. 3. Add a method to the class to insert a new student with the following attributes. This method should take all columns in as parameters: 98999, Charlie, Comp Sci., 122 4. Create a Java class that takes a command line parameter to delete a student 5. Create a class that write out the contents of the Instructor table to a comma separated file.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Please check i...


Anonymous
Really useful study material!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags