I am using the Oracle 10g express edition

Is it possible to connect using a Java program? If so, what connect string should I be using?

Hi,
This is with reference to connecting to Oracle Database XE using a java-based program (for example NetBeans).
Step 1: Add a CLASSPATH
/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/jdbc/libs/
Step 2: Add ojdbc14.jar to the directory of your project.
Step 3: Import Java SQL and Oracle JDBC Driver.
import java.sql.*;
import oracle.jdbc.pool.OracleDataSource;
Step 4: Create an OracleDataSource using your username and password. The connection string should look similar to the below mentioned.
public Connection getConnection()
throws ClassNotFoundException, SQLException {
OracleDataSource myds = new OracleDataSource();
myds.setUser("username");
myds.setPassword("pasword");
myds.setURL("jdbc:oracle:thin:@your.server:1521/xe");
Connection conn = myds.getConnection();
return conn;
Step 5: Create a sample data table. The set of statements should look similar to the below mentioned.
public void createTable(Connection conn) throws SQLException {
Statement stmt = null;
String query;
try {
query = "CREATE TABLE tutorials title VARCHAR2(70), author VARCHAR2(40),
ref_number NUMBER(7,0) CONTRAINT pk_tutorials PRIMARY KEY,
submit_date DATE DEFAULT SYSDATE";
stmt = conn.createStatement();
stmt.executeUpdate(query);
finally {
if(stmt != null){
stmt.close();
Should this solve your problem, kindly mark the thread as answered.
Regards,
Naveed.

Similar Messages

  • Is the SQL * Plus Worksheet included in the Oracle 10g Express Edition?

    Hello All,
    I need to install Oracle 10g for a SQL class that I will be taking this year. I will be installing it in my laptop (Pentium 4, 1GB RAM). I was told by the Professor that I needed to have the SQL*Plus Worksheet. I would like to know which version of Oracle do I need to install, and If it includes the SQL*Plus Worksheet.
    This is my first time working & installing Oracle, so I would appreciate if anyone could guide me thru this process.
    Thanks a lot,
    Ed

    No, it is not included.
    However, the same functionality, and more, is in Oracle SQL Developer - also available free and download-able from the same area as Oracle Express Edition.
    Ask your prof why he want Worksheet. If it's only for the ability to scroll and correct previous SQL (eg: easier time correcting mistakes), and loading scripts, ask if SQL Developer would be allowed. It's much superior and allows you to use XE, which will not sink your laptop like the EE version will.

  • Install problems using VISTA, Oracle 10g Express edition and VS2005

    Hi,
    Has anybody got this to work yet?
    I'm on Vista Release Candidate 1, VS2005 and 10g Express.
    When I try to install the tools (ODTwithODAC10202) the install crashes VS2005.
    I can see the tools on the Visual studio menus, but any attempt to use them gives me a "Oracle Developer Tools for Visual Studio failed to load" error message.
    Any ideas?

    Have you got the VS 2005 addin to work on Vista? I installed on XP then upgraded to Vista (RTM) and the add-in no longer works. Am wondering whether to uninstall/reinstall or wait for Oracle to certify use with Vista.

  • Java Connection Pooling issue with Oracle 10g Express Edition

    Hello
    I have a Java based web application that uses the Oracle 10g Express Edition database. I am using a connection pool to get connections to the database.
    I use the NetBeans IDE and run my web application on the bundled Tomcat server(5.5.7) that comes with the IDE. Though when I initially run the application from the IDE, the connection pool is set up fine, when I recompile my java code and try to run the application again, I get the following error each time:
    Listener refused the connection with the following error:
    ORA-12516, TNS:listener could not find available handler with the
    matching protocol stack.
    The logs before the error shows up, indicate that the connection pool object is fine and gives me the number of available connections and the number of active connections and so on, which I have printed from the constructor of the Connection Pool class:
    For e.g.:
    Cache size = 17
    Available Connections = 17
    Cache Limit = 1000
    Active size = 0
    However, if I kill my Tomcat server process and run the application again, it works fine with no error.
    I looked around for possible causes and solutions and all I could find
    was increasing the processes parameter value in the init.ora file. I have increased the parameter value to from 100 to 20000 now, in increments of 500/1000 each time but it hasnt worked so far.
    Someone else suggested that I increase the size of my connection pool; I initially had it set to a minimum limit of 5, an initial limit of 10 and a maximum limit of 1000. However if I set the Initial Limit to anything above 17 connections, I see the following log on the Bundled Tomcat log and my application doesn't run at all:
    Log: Loading JDBC Driver : class=oracle.jdbc.driver.OracleDriver ...
    Log: Loaded JDBC Driver
    Log: Connection with URL=jdbc:oracle:thin:@localhost:1521:xe as username/password
    Error code not handled : 0
    Exception Message :java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12519, TNS: no appropriate service handler found
    The Connection descriptor used by the client was:
    localhost:1521:xe
    // End of log
    And the Bundled Tomcat server automatically shuts down.
    Again the System.out statements from the Connection Pool class constructor show that the cache has been initialized and that currently there are free connections available in the pool.
    E.g.
    Cache size = 18
    Available Connections = 18
    Cache Limit = 1000
    Active size = 0
    Has anyone faced anything similar? Could someone please suggest what I'm doing wrong here and what I should do to set right this problem?
    Swetha

    hello, please pardon me, my english is basic. i do of my best. i had the same problem until reading the pdf documentation 2 days for java devvelloper.it is simple, follow this way.
    try {OracleDataSource ds;
         Connection conn;
      ds = new OracleDataSource();
      ds.setURL("jdbc:oracle:thin:@localhost");
      conn = ds.getConnection("userid","password");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    don't forget to Dowload the user client of oracle Express Edition. do the rest of your program and it will work. take a look to the documentation pdf for java develloper. all it is explained.  good look                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • MSAccess 2003-plugin-Oracle 10g Express Edition

    Hello!
    Say, I've read a few posts on people who seem to have this similar problem about the MSAccess plugin. However, I have this situation and I'm still getting the 'Plugin not being found' error message...
    I have Windows XP Pro SP2 and MSAccess 2003 and using the Oracle 10g Express Edition.
    I have downloaded and unzipped the 'omwb.zip' file into: C:\omwb1010 - directory. After this unzip, I have downloaded the MSAccess.zip file into the C:\omwb1010\omwb\plugins - directory, 'saving' it as MSAccess.jar. I then go to the 'bin' directory and run the omwb.bat file. I enter the appropriate information for the 'Oracle Database Repository'. I use 'SYSTEM' for the 'Username' (is this correct or do I use something like the 'HR' that is already created?). When I click 'OK', the 'Plugin' error message pops up!
    Where am I going wrong??
    Thanks in advance...!!
    Dan...

    Hello!
    In thinking about my problem here... Since I have WIN XP Pro SP2 installed, I don't need to install the MDAC file. But, is the OMWB bat file checking the 'drivers' folder under the omwb\ directory for the driver and Not where the WIN XP Pro SP2 put it...? This 'stuff' is new to me and so IF this is the case, I assume I would need to copy this driver from its current location and paste it to this 'drivers' folder. So, where would I go look for this 'driver' to copy??
    Thanks in advance...!!

  • Oracle 10g Express Edition installation problem in windowsXP

    while installing the Oracle 10g Express Edition in windows XP ,
    it is showing an error like this ,
    the cabinet file 'Data1.cab' required for this installation is corrupt and cannot be used. This could indicate a network error.
    If anybody knows solution to this problem plz mail me to this email id
    [email protected]

    I think you should probably download the file again, it might be corrupt.
    ~Jer

  • How get scott user database schema in oracle 10g express edition

    hi
    plz any on can tell me how to get the scott user database table details into the oracle 10g express edition
    Iam created the user as scott but but i didn't get the table details
    ...plz give me the details correctly.

    You will go into this path C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. You can get scott.sql script yhen you need to run the script like @C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. Otherwise you just copy the below script and save it into one file then run that file using @
    Rem Copyright (c) 1990 by Oracle Corporation
    Rem NAME
    REM    UTLSAMPL.SQL
    Rem  FUNCTION
    Rem  NOTES
    Rem  MODIFIED
    Rem    gdudey       06/28/95 -  Modified for desktop seed database
    Rem    glumpkin   10/21/92 -  Renamed from SQLBLD.SQL
    Rem    blinden   07/27/92 -  Added primary and foreign keys to EMP and DEPT
    Rem    rlim       04/29/91 -          change char to varchar2
    Rem    mmoore       04/08/91 -          use unlimited tablespace priv
    Rem    pritto       04/04/91 -          change SYSDATE to 13-JUL-87
    Rem   Mendels     12/07/90 - bug 30123;add to_date calls so language independent
    Rem
    rem
    rem $Header: utlsampl.sql 7020100.1 94/09/23 22:14:24 cli Generic<base> $ sqlbld.sql
    rem
    SET TERMOUT OFF
    SET ECHO OFF
    rem CONGDON    Invoked in RDBMS at build time.     29-DEC-1988
    rem OATES:     Created: 16-Feb-83
    GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY TIGER;
    ALTER USER SCOTT DEFAULT TABLESPACE USERS;
    ALTER USER SCOTT TEMPORARY TABLESPACE TEMP;
    CONNECT SCOTT/TIGER
    DROP TABLE DEPT;
    CREATE TABLE DEPT
           (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
        DNAME VARCHAR2(14) ,
        LOC VARCHAR2(13) ) ;
    DROP TABLE EMP;
    CREATE TABLE EMP
           (EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
        ENAME VARCHAR2(10),
        JOB VARCHAR2(9),
        MGR NUMBER(4),
        HIREDATE DATE,
        SAL NUMBER(7,2),
        COMM NUMBER(7,2),
        DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT);
    INSERT INTO DEPT VALUES
        (10,'ACCOUNTING','NEW YORK');
    INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
    INSERT INTO DEPT VALUES
        (30,'SALES','CHICAGO');
    INSERT INTO DEPT VALUES
        (40,'OPERATIONS','BOSTON');
    INSERT INTO EMP VALUES
    (7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);
    INSERT INTO EMP VALUES
    (7499,'ALLEN','SALESMAN',7698,to_date('20-2-1981','dd-mm-yyyy'),1600,300,30);
    INSERT INTO EMP VALUES
    (7521,'WARD','SALESMAN',7698,to_date('22-2-1981','dd-mm-yyyy'),1250,500,30);
    INSERT INTO EMP VALUES
    (7566,'JONES','MANAGER',7839,to_date('2-4-1981','dd-mm-yyyy'),2975,NULL,20);
    INSERT INTO EMP VALUES
    (7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-yyyy'),1250,1400,30);
    INSERT INTO EMP VALUES
    (7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-yyyy'),2850,NULL,30);
    INSERT INTO EMP VALUES
    (7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-yyyy'),2450,NULL,10);
    INSERT INTO EMP VALUES
    (7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87')-85,3000,NULL,20);
    INSERT INTO EMP VALUES
    (7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-yyyy'),5000,NULL,10);
    INSERT INTO EMP VALUES
    (7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-yyyy'),1500,0,30);
    INSERT INTO EMP VALUES
    (7876,'ADAMS','CLERK',7788,to_date('13-JUL-87')-51,1100,NULL,20);
    INSERT INTO EMP VALUES
    (7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy'),950,NULL,30);
    INSERT INTO EMP VALUES
    (7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
    INSERT INTO EMP VALUES
    (7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
    DROP TABLE BONUS;
    CREATE TABLE BONUS
        ENAME VARCHAR2(10)    ,
        JOB VARCHAR2(9)  ,
        SAL NUMBER,
        COMM NUMBER
    DROP TABLE SALGRADE;
    CREATE TABLE SALGRADE
          ( GRADE NUMBER,
        LOSAL NUMBER,
        HISAL NUMBER );
    INSERT INTO SALGRADE VALUES (1,700,1200);
    INSERT INTO SALGRADE VALUES (2,1201,1400);
    INSERT INTO SALGRADE VALUES (3,1401,2000);
    INSERT INTO SALGRADE VALUES (4,2001,3000);
    INSERT INTO SALGRADE VALUES (5,3001,9999);
    COMMIT;
    SET TERMOUT ON
    SET ECHO ON

  • Problems to initiate oracle 10g express edition

    Good afternoon I am speaking of Brazil with a text translator.
    But I have installed Hundreds and I am trying to install oracle 10g express edition release 2.
    I am with a problem in the Oracle 10g Express Edition in the installation part when I vo to initiate the service, it does not initiate.
    And when I give I command /etc/init.d/oracle-xe status appears the following message: Your default context is user_u: system_r: unconfined_t. Of it you want you choose different one? [n]
    I do not know more what to make to decide this.
    I thank the attention.
    Gabriel.
    Message was edited by:
    user523701

    Oracle XE has it's own forum - to register and discuss XE problems with XE experts use URL http://www.oracle.com/technology/xe/registration
    Once you have registered, you sign in to the forums and the link to the XE forum is there. But you do have to sign in as the user who registered XE.
    You will also need to provide a few more pieces of information:
    1) actual distro and version of Linux
    2) userid used to install XE (should be root)
    3) userid used to run "/etc/init.d/oracle-xe start" (should be root)

  • Oracle 10G EXPRESS EDITION  suitable for windows7

    hi to all
    can u  guys plz provide me the oracle 10g express edition  download link for windows7
    i had already downloaded one for windows7 but when i go to instal it i cant able to run it, and that to the downlOaded file says THE PUBLISHER OF THIS PROGRAM COULDN'T BE VERIFIED.
    SO CAN U PLZ PROVIDE ME LINK ASAP.
    THANKS IN ADVACE.

    yaa.i downloaded the oracleXEUNIV FILE.
    but the file dont have the .exe extension,and i cant able to run it.
    after i run the file
    the system says
    DO U WANT TO OPEN THE FILE
    i click on OPEN
    THEN is shows OPEN WITH INTERNET EXPLORER,ADOBE.........
    CAN U PLZ LET ME HOW TO INSATLL IT..

  • Oracle 10g express edition ..ampersand substitution variable

    when i enter the ampersand substitution variable and run the script in the oracle 10g express edition it is giving me the error of (ORA-01008: not all variables bound)...can someone please indicate what the problem is..
    thank you

    i am running the script in the browser but when i run it it does not give me the possibility to enter the value and that error which i mentioned before comes instantly
    reuben

  • Columns Display Support in Oracle 10g Express Edition..................

    I am working with the Oracle 10g Express Edition, and I Created a Table with 52 Fields and even successfully inserted data into the table via Java Program. But the problem is when I am displaying the table from the Oracle 10g Express Edition Interface, it is displaying only first 31 Fields and displaying "<div class="fielddata">First 31 columns displayed.</div>". What should i do if I want to display all the 52 columns. Awaiting for the Reply. Thank You..

    duplicate post
    Columns Display Support in Oracle 10g Express Edition..................

  • How to connect to ORACLE 10g Express Edition using struts?

    HI! There
    I am using Oracle Jdeveloper as IDE, JBoss as application server, Oracle 10G Express edition as DBMS. As I am new to Struts & Jboss, so Can anybody tell me that How to connect to Database? Please also give Struts-config.xml datasource config too.
    If someone can give a set of codes to enter and retrieve the data to/from database it will be really help full for me. Well connectivity with any version e.g. 9i, 10g, 10g XE will do......
    Thanks

    Well I have already configure a datasource in struts-config.xml as Stated below:
    <data-sources>
    <data-source>
    <set-property property="autoCommit" value="false"/>
    <set-property property="description" value="Data Source Config. for SMS"/>
    <set-property property="driverClass" value="oracle.jdbc.OracleDriver"/>
    <set-property property="maxCount" value="4"/>
    <set-property property="minCount" value="2"/>
    <set-property property="password" value="password"/>
    <set-property property="url" value="jdbc:oracle:thin:@127.0.0.1:1521:XE"/> <set-property property="user" value="sms"/>
    </data-source>
    </data-sources>
    Now the Only problem That I am facing is how to look up this data source from a Java file of Model layer.
    Please Guide me further

  • Not able to create partitions using Oracle 10g express edition

    Hello Everyone,
    I downloaded Oracle 10g express edition as the documentation for the same says that it supports partitioning of the table.
    But when I try to run a command like
    CREATE TABLE sales_range
    (salesman_id NUMBER(5),
    salesman_name VARCHAR2(30),
    sales_amount NUMBER(10),
    sales_date DATE)
    PARTITION BY RANGE(sales_date)
    PARTITION sales_jan2000 VALUES LESS THAN(TO_DATE('02/01/2000','DD/MM/YYYY')),
    PARTITION sales_feb2000 VALUES LESS THAN(TO_DATE('03/01/2000','DD/MM/YYYY')),
    PARTITION sales_mar2000 VALUES LESS THAN(TO_DATE('04/01/2000','DD/MM/YYYY')),
    PARTITION sales_apr2000 VALUES LESS THAN(TO_DATE('05/01/2000','DD/MM/YYYY'))
    I get the following error
    "ORA-00439: feature not enabled: Partitioning"
    Please let me know what is causing the issue/error and how to resolve it.
    Thanks.

    Where did you read that the express edition supports partitioning? I would strongly suspect that there was an error in the documentation-- partitioning is an extra cost option on top of an enterprise edition database. Perhaps you are confusing the personal edition (which does support partitioning) with the express edition?
    Justin

  • Using JDeveloper with Oracle 10g Express Edition

    Hi,
    can JDeveloper 11g 11.1.1.4.0 Studio Edition be used to develop applications connection with Oracle 10g Express Edition?
    If not, is there a version downloadable that can?
    TIA

    Yes, it can.
    John

  • Can't uninstall or reinstall oracle 10g express edition in w/server 2003

    Hi,
    I need help from all of you, i already install oracle 10g express edition in
    windows server 2003 in D drive. but i can't remove because the oracle not in
    the add remove program so i download the windows install clean up to remove
    but after remove it still in the all program i still can start and stop the
    database but can't go to the database home page.The error message (the install
    cannot proceed as service OracleServiceXE is present on the system. Remove the
    service , reboot the systemand retry the installation) can any one guide me to use
    command prompt to remove.
    My email address [email protected]
    Thanks

    Hi,
    Perform the following steps, this will solve your problem and can go with new installation. :-)
    (Only perform the steps 7.2 section and here is the link : http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25143/toc.htm#BABDJDCD
    Manually Removing Oracle Database XE
    If the deinstallation is interrupted, follow these steps to manually remove Oracle Database XE from your computer:
    Step 1: Stop the Oracle Database XE Services
    Step 2: Remove the Oracle Database XE Registry Editor Settings
    Step 3: Update the System Variable Path
    Step 4: Remove Oracle Database XE from the Start Menu and Desktop
    Step 5: Remove the Oracle Database XE Directories
    Step 6: Install and Run the Windows Installer CleanUp Utility
    7.2.1 Step 1: Stop the Oracle Database XE Services
    Follow these steps:
    1. Open the Windows Services utility: From the Start menu, select All Programs, then Administrative Tools, and then Services.
    2. If any of the following Oracle services exist and have the status Started, then select each of the services, and click Stop:
    OracleXE
    OracleXETNSListener
    OracleJobSchedulerXE
    OracleXEClrAgent
    OracleMTSRecoveryService
    3.
    Exit Services.
    See also the Microsoft online help for more information on stopping services.
    7.2.2 Step 2: Remove the Oracle Database XE Registry Editor Settings
    Follow these steps:
    1.
    Log on to Windows with Windows administrative privileges.
    2.
    Ensure that you followed the instructions under "Step 1: Stop the Oracle Database XE Services" to stop the Oracle Database XE services.
    3.
    Start the Registry Editor at a command prompt:
    SYSTEM_DRIVE:\> regedit
    4.
    Go to HKEY_CLASSES_ROOT.
    5.
    Delete the following keys:
    NEED TO CONFIRM THE XE-SPECIFIC ONES.
    6.
    Go to HKEY_CURRENT_USER\Software.
    7.
    Under Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs, delete the Oracle Database 10g Express Edition key.
    8.
    Go to HKEY_LOCAL_MACHINE\SOFTWARE and search for the ORACLE group key.
    9.
    Expand the ORACLE group key and then delete the KEY_XE and OracleMTSRecoveryService keys.
    10.
    Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI.
    11.
    Expand the ODBCINST.INI key and remove the Oracle in XE key.
    12.
    Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
    13.
    Delete the following keys:
    OracleServiceXE
    OracleXEClrAgent
    OracleXETNSListener
    14.
    Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application.
    15.
    Delete the Oracle.xe key.
    16.
    Exit the Registry Editor.
    17.
    Restart your computer.
    Thanks,
    Rams...
    Edited by: user10888288 on May 3, 2010 5:58 AM

Maybe you are looking for

  • Fixed Assets

    Hi experts, I did a acquisition with vendor through fixed assets add-on but I cannot see the particular invoice when I run the Purchase Analysis report(by Purchase Invoice)?So the report is inaccurate. Why the fixed assets add-on is not linked with S

  • Sorting data for export

    I need to use one form (a questionnaire) with various groups.  Will the data for everyone who completes my form always be appended to the same file for export?  Can I export only part of the data (i.e. that for a specific group) instead of all of it

  • Mouse double click on single click

    My mouse has been double clicking on a single click since changing to Mavericks 10.9. I have tried different mouse brands from Apple to Rapoo and everything inbetween. I have played with the mouse settings and rebooted, reset the pram and nothing wor

  • How do I delete some history but not all without it crashing?

    I remember that Firefox used to allow deleting of only some history but not the most recent. For example, I was able to go into Options and under the Privacy tab, I could choose for Firefox to remember the last 7 days, 30 days, etc. Now, it seems tha

  • Authoring for PC environment

    Hey all, Any tips for authoring for a bunch of PC users ? They say it plays jerkily. They have DVD players except they've lost all the remotes for them so the players are useless (I LOVE THIS BUSINESSSSS!) I am using FCE and I also have Roxio 10 with