Jfinal Connect Oracle Database Combat

Source: Internet
Author: User
Tags uuid sqlplus

To add an Oracle driver package:

Add Ojdbc6.jar to Lib


To configure Plug-ins in controller:

/** * Configuration plug-in */public void Configplugin (Plugins me) {/*//configuration c3p0 database connection Pool plug-in c3p0plugin c3p0plugin = new C3p0plugin (g
		Etproperty ("Jdbcurl"), GetProperty ("user"), GetProperty ("password"). Trim ());
		
		Me.add (C3p0plugin);
		Configure ActiveRecord plugin Activerecordplugin arp = new Activerecordplugin (c3p0plugin);
		Me.add (ARP);	Arp.addmapping ("blog", Blog.class);	Map Blog table to blog model default is ID arp.addmapping ("em_messages_entities", "uuid", emmessagesentities.class); Map Em_messages_entities table to emmessagesentities model arp.addmapping ("Em_messages_bodies", "msg_id",	Emmessagesbodies.class);	Map Em_messages_bodies table to emmessagesbodies model msg_id for table primary Key name Arp.addmapping ("Em_user", "username", emuser.class); Map Em_user table to Useruploadvideo model ROWID for table primary Key name Arp.addmapping ("Upload_user_video", "Videoname", Useruploadvideo.class)	; Map Upload_user_video table to Useruploadvideo model videoname for table's primary key name * */*oracle configuration/c3p0plugin cp = new C3p0plugin (getprope Rty ("Jdbcurl"), GetProperty ("user"), GetProperty ("PasswoRd "). Trim ());
		Configure Oracle-driven CP. Setdriverclass ("Oracle.jdbc.driver.OracleDriver");
		Me.add (CP);
		Activerecordplugin arp = new Activerecordplugin (CP);
		Me.add (ARP);
		Configure the Oracle dialect Arp.setdialect (new Oracledialect ());
Configuration property name (field name) not sensitive container factory arp.setcontainerfactory (New Caseinsensitivecontainerfactory ());
Arp.addmapping ("User", "user_id", User.class);	Arp.addmapping ("Em_messages_entities", "uuid", emmessagesentities.class); Map Em_messages_entities table to emmessagesentities model//arp.addmapping ("Em_messages_bodies", "msg_id",	Emmessagesbodies.class);	Map Em_messages_bodies table to emmessagesbodies model msg_id for table primary Key name Arp.addmapping ("Em_user", "username", emuser.class); Map Em_user table to Useruploadvideo model ROWID for table primary Key name//arp.addmapping ("Upload_user_video", "Videoname",	Useruploadvideo.class); Map Upload_user_video table to Useruploadvideo model videoname for table primary key name}


Configuration file:

Jdbcurl =jdbc:oracle:thin: @localhost: 1521:jfinalemchat
user = SCOTT
Password =123456789
DevMode = True

Note: of which: Jfinalemchat is your database sid

Right---> Property-->


"Listener does not currently know the SID given in Connect descriptor" exception:


Open the Listener.ora file first:

F:\app\qianhua\product\11.2.0\dbhome_1\NETWORK\ADMIN


# Listener.ora Network Configuration File:f:\app\qianhua\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.


Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = Clrextproc)
(Oracle_home = F:\app\qianhua\product\11.2.0\dbhome_1)
(program = Extproc)
(Envs = "Extproc_dlls=only:f:\app\qianhua\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)

(Sid_desc =
(Global_dbname = jfinalemchat)
(Oracle_home = F:\app\qianhua\product\11.2.0\dbhome_1)
(Sid_name = jfinalemchat)
)
)


LISTENER =
(Description_list =
(DESCRIPTION =
(address = (PROTOCOL = IPC) (KEY = EXTPROC1521))
(address = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))
)
)


Adr_base_listener = F:\app\qianhua


Oracle Local Service:



Reference resources:



Account:
Http://www.blogjava.net/wangdetian168/archive/2013/09/09/403858.html


Download:
Http://www.oracle.com/technetwork/cn/database/enterprise-edition/downloads/112010-win32soft-098630-zhs.html


Installation Instructions:
Http://www.jb51.net/article/32616.htm


Instructions for use:

The

http://jingyan.baidu.com/article/3c343ff72c71c10d3679636a.html

Database usage is detailed: [3]sql developer How to configure
http:/ /jingyan.baidu.com/article/e4511cf33f289e2b845eafb6.html


Create a new database:
http://jingyan.baidu.com/ article/90bc8fc80c01f2f653640c1f.html


Connect the database using Oracle Sqldeveloper and create users
http://blog.csdn.net/ xw13106209/article/details/6594738


Action:
Oracle Opens cmd Command Window input sqlplus username/pass@server_name


Sys Password:
If you forget, you can modify the SYS password with the following command.
1. Log on to the local server first
2. Enter the command line
2.sqlplus/as sysdba
4.alter user sys identified by ' Enter password '. Insufficient permissions for
http://blog.csdn.net/zzjjian333/article/details/8286341


:
Log on in sys and execute: GRANT CREATE any TABLE to SCOTT


Browser opens Oracle Action interface:
https://host name: 1158/em


Http://blog.csdn.net/wl_ldy/article /details/5920146

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.