Coder Social home page Coder Social logo

jdbctest's Introduction

1) pull Oracle XE image

docker pull oracleinanutshell/oracle-xe-11g

2) run image as docker container

docker run -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true oracleinanutshell/oracle-xe-11g

3) Check container id was running

docker ps

4) run bash in container to operate with Oracle XE instance

docker exec -it 1a9f39ca5c93 bash

5) create table in sqlplus

sqlplus system/oracle@localhost:1521/XE

SQL> drop table emp;

Table dropped.

SQL> create table emp as select 1 col1, 'Bogdan' col2, 'Dmytrovych' col3, 'Koval' col4 from dual;

Table created.

SQL> select * from emp;

  COL1 COL2   COL3       COL4

     1 Bogdan Dmytrovych Koval

SQL> desc emp Name Null? Type


COL1 NUMBER COL2 CHAR(6) COL3 CHAR(10) COL4 CHAR(5)

6) Download oracle thin client driver ojdbc8.jar into work dir

https://www.oracle.com/database/technologies/jdbc-ucp-122-downloads.html

7) Compile java code to class

!!! Urgent !!! on Linux -cp list separated by : on Windows -cp list separated by ;

javac -cp "c:\Dima\work\ojdbc8.jar;c:\Dima\work" OracleCon.java

8) Run java class

java -cp "c:\Dima\work\ojdbc8.jar;c:\Dima\work" OracleCon

jdbctest's People

Contributors

dkovalua avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.