Question

build a comic database management system using database oracle and connect it to java

build a comic database management system using database oracle and connect it to java

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Steps to connect oracle database with java

  1. import java.sql.*;  
  2. class OracleCon{  
  3. public static void main(String args[]){  
  4. try{  
  5. //step1 load the driver class  
  6. Class.forName("oracle.jdbc.driver.OracleDriver");  
  7.   
  8. //step2 create  the connection object  
  9. Connection con=DriverManager.getConnection(  
  10. "jdbc:oracle:thin:@localhost:1521:xe","system","oracle");  
  11.   
  12. //step3 create the statement object  
  13. Statement stmt=con.createStatement();  
  14.   
  15. //step4 execute query  
  16. ResultSet rs=stmt.executeQuery("select * from emp");  
  17. while(rs.next())  
  18. System.out.println(rs.getInt(1)+"  "+rs.getString(2)+"  "+rs.getString(3));  
  19.   
  20. //step5 close the connection object  
  21. con.close();  
  22.   
  23. }catch(Exception e){ System.out.println(e);}  
  24.   
  25. }  
  26. } i
Add a comment
Know the answer?
Add Answer to:
build a comic database management system using database oracle and connect it to java
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ADVANCED DATABASE(ORACLE DATABASE 11g Masterkill) Question 5 (Marks: 10) Mike is a database administrator who has...

    ADVANCED DATABASE(ORACLE DATABASE 11g Masterkill) Question 5 (Marks: 10) Mike is a database administrator who has recently joined an online car rental company who captured and stored data in Microsoft Excel spreadsheets. He is tasked with creating a database and migrating all the data into a relational database management system. Mike wants to implement an Oracle database, but is unsure of the Oracle 11g edition to use. Explain to Mike the various program categories that will enable him to operate...

  • 1. Discuss how users can be authenticated by the operating system to connect to the Oracle...

    1. Discuss how users can be authenticated by the operating system to connect to the Oracle database. how does SQL*Plus relate to this method? 2. What methods does Oracle support for authentication by the network? 3. What are the key components you would include in a password policy? Why? 4. Give an example how you define a good password policy. Can you design a general password policy? Or do you need to design it to consider a particular situation always?

  • ***JAVA*** Connect to a database to extract the data. This does not need to be a...

    ***JAVA*** Connect to a database to extract the data. This does not need to be a real database. For this portion of your project, you are just writing the code to connect to a database. You are not actually connecting to any specific database. You must include all of the necessary code to read from and write to the database. Just be sure to comment out all of the code so you can still run your program.

  • How would I make this database using Oracle SQL developer? Here is the link to the...

    How would I make this database using Oracle SQL developer? Here is the link to the scheme of the database. https://ibb.co/fy1rt6

  • Please help me answer the following. Database Management System please No handwriting thank you Consider the...

    Please help me answer the following. Database Management System please No handwriting thank you Consider the following two tables: Sales (SID, VID, Commission) Sales_Person (SalesPersonID, SName, STitle, SPhone, Sum_Commission) -   Using Oracle notation, write a trigger that allows to keep the Sum_Commission attribute of Sales_Person equal to the sum of the Commission attribute in Sales for each sales person.

  • A risk analyst gives Oracle Corp., the enterprise software and database management firm, a CAPM (Capital...

    A risk analyst gives Oracle Corp., the enterprise software and database management firm, a CAPM (Capital Asset Pricing Model) equity beta of 1.20. The risk-free rate is 4%. Required: Prepare a table with the cost of capital (cost of equity) that you would calculate for the equity with the following estimates of the market risk premium. (12 points) 4.5% 6.0 % 6.5% 7.0 %

  • Using oracle sql for creating database nd inserting data I want to write a constraint on...

    Using oracle sql for creating database nd inserting data I want to write a constraint on the date of birth so that any age will be only be from 21 to 60 This constraint should be calculated automatically using sysdate or the system date Hint: data type is date Also for the car year model I want to write a constraint to check that it is not older than 10 years (the field data type is integer) I want it...

  • Q2- Database management system (DBMS) is the main software tool of the database management approach because...

    Q2- Database management system (DBMS) is the main software tool of the database management approach because it controls the creation, maintenance, and use of the databases of an organization and its end users. List four common software Components with their functions for database management system. Component Function

  • php 1A)connect to the database using the PDO class (you should be able to connect with...

    php 1A)connect to the database using the PDO class (you should be able to connect with the username "root" and an empty password) 1C) select all the product names and their list prices, and print them out in a neat HTML table.

  • using the java programming language Design a "Student Record Management System" in java including the following...

    using the java programming language Design a "Student Record Management System" in java including the following functionalities: 1 Input: Input student num, DOB, address, phone number etc. Input course titles, course number, time/locations. Input grade of each course for each student. 2 Process: Calculate GPA for each student. Sort and search on given criteria. 3 Output: Search by student num, show the student's information (including all courses and grades). Search by course num, show course information (including all students and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT