Jfinal Connecting Oracle Database Combat

Source: Internet
Author: User
Tags uuid sqlplus

To add an Oracle driver package:

Adding Ojdbc6.jar in Lib


To configure the plug-in in the controller:

/** * Configuration plugin */public void Configplugin (Plugins me) {/*//config C3P0 database connection pool plug-in c3p0plugin c3p0plugin = new C3p0plugin (GetProperty (" Jdbcurl "), GetProperty (" user "), GetProperty (" password "). Trim ()); Me.add (c3p0plugin);// Configure the ActiveRecord plugin activerecordplugin arp = new Activerecordplugin (c3p0plugin); Me.add (ARP); arp.addmapping ("blog", Blog.class);//Mapping blog table to the blog model by default is idarp.addmapping ("em_messages_entities", "uuid", emmessagesentities.class);//Mapping EM _messages_entities table to Emmessagesentities model arp.addmapping ("Em_messages_bodies", "msg_id", Emmessagesbodies.class); /Map the Em_messages_bodies table to the Emmessagesbodies model msg_id the primary key name for the table arp.addmapping ("Em_user", "username", emuser.class);//Map Em_ The user table to the Useruploadvideo model ROWID the primary key name for the table arp.addmapping ("Upload_user_video", "Videoname", useruploadvideo.class);// Map the Upload_user_video table to the Useruploadvideo model videoname the primary key name for the table *//*oracle Configure */c3p0plugin CP = new C3p0plugin (GetProperty (" Jdbcurl "), GetProperty (" user "), GetProperty (" password "). Trim ());//Configure the Oracle drive CP. Setdriverclass ("Oracle.jdbc. Driver. Oracledriver "); Me.add (CP); Activerecordplugin arp = new Activerecordplugin (CP); Me.add (ARP);//Configure Oracle Dialect Arp.setdialect (new Oracledialect ());// Configuration attribute name (field name) case insensitive 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 is the primary key name of the table arp.addmapping ("Em_user", "username", emuser.class);//Map Em_user table to Useruploadvideo model ROWID is the primary key name of the table//arp.addmapping ("Upload_user_video", "Videoname", useruploadvideo.class);//Map UPLOAD _user_video table to Useruploadvideo model videoname as table's primary key name}


Configuration file:

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

Note: Where: Jfinalemchat is your database sid

Right--Properties--


"Listener does not currently know of 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



Attachment 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:

Detailed database usage: [3]sql developer How to configure
Http://jingyan.baidu.com/article/e4511cf33f289e2b845eafb6.html


To create a new database:
Http://jingyan.baidu.com/article/90bc8fc80c01f2f653640c1f.html


Use Oracle Sqldeveloper to connect to a database and create users
http://blog.csdn.net/xw13106209/article/details/6594738


Operation:
Oracle Open cmd Command Window inputSQLPLUS username/[email protected]_name


SYS Password:
If you forget, you can modify the SYS password with the following command.
1. First login to the local server
2. Go to the command line
2.sqlplus/as SYSDBA
4.alter user sys identified by ' Enter password '.
http://blog.csdn.net/zzjjian333/article/details/8286341


Insufficient permissions:
Log in with SYS, and then execute:GRANT CREATE any TABLE to SCOTT


The browser opens the Oracle operator interface:
HTTPS://Host name: 1158/em


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

Jfinal Connecting Oracle Database Combat

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.