Name of database connected to this application server

dears ,
i have Oracle Application Server 10g (10.1.2.0.2)
i want to get database UNIQUE_name that is connect to this application server !!!
i run this command SELECT sys_context('USERENV', 'DB_UNIQUE_NAME') FROM dual;
it gave me name of application server not database ??
any suggestion plss??

Hi PAul,
show parameter name,
will work for 9i database..but will not provide "DB_UNIQUE_NAME"
10g it will work...have not tried for 11g databse
This will be the output if you use the above cmd on 10g
NAME TYPE VALUE
db_file_name_convert string
db_name string xyz
db_unique_name string xyz
global_names boolean FALSE
instance_name string xyz
lock_name_space string
log_file_name_convert string
service_names string xyz.momt.com
sp_name string xyz
And the output if you use the above cmd on 9i
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> show parameter name
NAME TYPE VALUE
db_file_name_convert string
db_name string orcl
global_names boolean FALSE
instance_name string orcl
lock_name_space string
log_file_name_convert string
oracle_trace_collection_name string
oracle_trace_facility_name string oracled
plsql_native_make_file_name string
service_names string orcl
have editted my previous post accordingly,
Regards
Fabian

Similar Messages

  • Error in connecting sqlplus in application server

    hi,
    i am working in connecting two servers.one is application server and another one is database server.........i have set the environmental variable for sid as two_task=SID_name...so while connecting sqlplus from application server ....
    its showing an error
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Feb 8 15:20:22 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter user-name: xmluser
    Enter password:
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    what is the remedy for this error......
    thanks in advance
    R.Ratheesh

    hi,
    Iam attaching tnsnames.ora and listener.ora
    Tnsnames.ora
    RBTT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = application_server name)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER=DEDICATED)
    (SERVICE_NAME = RBTT)
    Listener.ora
    LISTENER =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST=application server_name)(PORT=1521))
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    #BEQUEATH CONFIG
    (GLOBAL_DBNAME=RBTT)
    (SID_NAME=RBTT)
    (ORACLE_HOME=home path of oracle in database server
    #PRESPAWN CONFIG
    (PRESPAWN_MAX=20)
    (PRESPAWN_LIST=
    (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
    )

  • Problem in Connecting to the application server

    Hi,
    I have used this JMS previously to connect to Sun Application Server PE 8 and it was working fine, but lately I installed Sun Application Server 9 (GlassFish) to my computer without removing the previous application server. I just changed all the classpath configuration pointing to the new application server instead of the old one. The previous application server is stopped and I mostly start the new application server without even starting the previous one. I also changed the folder name of the previous one, in case that something is pointing to that location.
    I created the ConnectionFactories and JMS destinations as I did before, and the code is the same, but unfortunately it is not working and it's giving me this error:
    com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: myhost; port: 3700" org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(O
    RBUtilSystemException.java:2348)
    Is it important to remove the first application server completely ?
    Have you ever encountered to such a problem?
    Regards,

    Hi,
    I guess it is nothing to do with the previous application server existance.
    It seems this is a known problem some time back if you have a java version "1.5.0"
    Find more information
    at http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5068014
    Regards
    Mandagiri

  • JDeveloper cannot connect to Oracle Application Server 10.1.3.x

    Hi, I am trying to create a connection from JDeveloper (on my desktop) to my oracle application server (10.1.3.x, on another machine). The JDeveloper version is 10.1.3.1.0.
    In step 1, I chose the connection type: "Oracle Application Server 10g 10.1.3".
    In Step 3, I chose "connect to group". I tried different host names and "OC4J Component/group name" but always got the following error msg:
    Error getting Cluster Config Set URLs for uri: deployer:cluster:opmn://hostname:6003/OC4J:default_group.
    I also tried to run JDeveloper from the same machine as my AS installed. The host name I used is "localhost" and the group name is "default_group" and the connection is successful. So it seems to me that my AS configuration is correct.
    May I ask what should be the correct "host name" and "group name" if I want to connect from a "remote" JDeveloper? And in what configuration file can I find such info.?
    Thanks a lot.
    Message was edited by:
    user575786

    hi user575786
    Would you mind sharing some more details about the changes you had to make to get it working or about the nature of the "misconfiguration" you mention?
    Maybe you have some pointers to documentation that helped you solve this?
    (tip : You can use "Your Control Panel" to make your name visible in forum posts.)
    thanks
    Jan Vervecken

  • NUMBER OF SESSIONS CONNECTED TO AN APPLICATION SERVER

    how i can find out number of database sessions connected to an application server
    thanks and regards
    Ajith

    Current Sessions is the current total number of open sessions for each application. Yes, you can use JMX or WLST within a script.
    The WebAppComponentRuntimeMBean mbean of your application provides this information through OpenSessionsCurrentCount attribute.
    For instance, in WLST enter:
    wls:/my_domain/serverRuntime/ApplicationRuntimes/my_application/ComponentRuntimes/my_app> cmo.getOpenSessionsCurrentCount()
    For JMX I suggest to you see [http://download.oracle.com/docs/cd/E13222_01/wls/docs91/wlsmbeanref/core/index.html]
    Edited by: Betino on 22/10/2009 11:26 AM

  • Info of connection client to application server

    I use Application Server 1.0.1 ...
    It is possible to know (using form 6i) some information about the client that actualy is connect to the application ??
    Infact userenv(terminal) reports always the name of the application server.
    Thank You

    Hi,
    If you query for the terminal in the database tables, they will show terminal as application server terminal as the database connection is opened from the application server.
    May be you need to find out client connection info at application server level.
    Regards
    Deepak

  • Applicaton Catalog - "Cannot connect to the application server" - Existing solutions have not worked

    Hi there,
    I have researched the problem below extensively online and found quite a varies array of solutions offered however they all seem to relate to the problem in that someone was setting up SCCM but couldn't get it to work. My situation is different in that the
    feature was working, no settings were changed however it has now stopped working.
    The issue is that if any user attempts to use the app catalog, they are shown the error screen which says "Cannot connect to the application server". It then says the problem might be temporary, try again later etc however it's not temporary.
    All the settings for the app catalog appear to be correct, as I would expect them to be as it was working (I am new to this company, the Desktop manager has told me it was working a few weeks ago).
    Does anyone know of a service in Windows, maybe something to do with the SQL side or certificates that could cause this issue? (although I checked certificates and again, looks fine). I'm almost at the point now of just restarting the server because
    if all else fails, turn it off and on again right?
    Cheers all.

    Hi, I just typed a long reply to this and then accidentally clicked a favourite on the Favourites bar and lost everything I typed :(
    -Checked the path in IIS to the \SMS_CCM\CMApplicationCatalog folder was OK and it was.
    -Checked that required .NET components including WCF are installed.
    -This one seemed a bit strange but ensured local service account has access to C:\Windows\Temp (this seemed very basic and unlikely but I tried it anyway due to desperation).
    -Checked that self-signed certificate was trusted by my PC attempting to access the App Catalog.
    -Checked SCCM services on the server are all running (where they should be, or set to manual as appropriate).
    I'm sure I've tried more than this, but these are the main things I can remember.
    Cheers.

  • Function Module that gives the names of the file in the Application Server.

    Hi Experts,
       Please give me a Function Module that gives the names of the file in the Application Server.
    Thanks,
    Debi.

    Hi,
    see these links
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
    http://abaplovers.blogspot.com/2008/05/function-module-sap-logged-in-users-to.html
    http://www.saptechies.com/abap-function-modules/
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/function-module-to-get-data-and-time-of-file-576751
    thanks
    karthik

  • The host is not authorized to connect to this Backup Server

    Hi experts,
    I'm trying to connect to a remote backup server S2_BS running on VM2 from a data server S1 running on VM1. When I issued following command in isql
    1> SYB_BACKUP...sp_who
    2> go
    Msg 7221, Level 14, State 2:
    Server 'S1', Line 1:
    Login to site 'SYB_BACKUP' failed.
    It failed to connect to its SYB_BACKUP (i.e. S2_BS is configured for SYB_BACKUP in this case).
    And I got following error in the error log of S2_BS:
    Jun 23 14:48:53 2014: Backup Server: 2.24.2.1: The host '10.43.13.204' is not authorized to connect to this Backup Server.
    Jun 23 14:48:53 2014: Backup Server: 2.6.2.10: Login information unavailable.
    I can ping VM2 from VM1 without any issue:
    $ ping 10.43.13.204
    PING 10.43.13.204 (10.43.13.204) 56(84) bytes of data.
    64 bytes from 10.43.13.204: icmp_seq=1 ttl=64 time=0.035 ms
    And have entry for S2_BS in /opt/sybase/interfaces on VM1:
    S2_BS
            master tcp ether 10.43.11.19 5002
            query tcp ether 10.43.11.19 5002
    And S2_BS is running correctly on VM2.
    I'm running ASE 15.7 SP110 on both VM1 and VM2.
    Could someone please let me know how to fix this?

    The message is due to a new security feature.  See Remote Dump Host Control
    for details on how to register your host with the remote backupserver.
    -bret

  • "System cannot connect to the application server" (Admin Client only)

    Hello Experts,
    I have a strange issue: I am getting "system cannot connect to the application server" when I am trying to launch BPC Admin.
    I successfully connect to the same application server with Excel client on the same PC.
    I am able to connect via Admin from another PC.
    The installation in question is a new installation. The only difference between my PC and a troubled one is IE7 vs. IE8 - IE8 is the one giving issues.
    BPC site is in Local Intranet zone. Windows Authentication is enabled. What am I missing? Local Policy? IE8 settings? Folder permissions (I'm local admin on both PCs)?
    It's BPC 7.5 SP05.
    Thanks in advance,
    Akim
    P.S. OS: Windows Server 2003 SP2 32-bit (Citrix box).
    Edited by: Akim Zubarchuk on Mar 30, 2011 12:28 AM

    Hi Akim,
    Check client diagnostic for admin client can provide good information.
    Any way if you are able to connect with excel client not with admin client I will say:
    1. Check the rights of user used to connect with admin console
    2. Check proxy settings
    3. Disable antivorus or firewall into that computer.
    4. Make sure the installation of admin client was correct done.
    In my opinion it is a big probability to be point 3 or 4.
    Regards
    Sorin Radulescu

  • "Could not connect to this SMTP server" error box.

    I suspect this is common, but what do I do? I get an error box when I attempt to send outgoing mail from Mail. Connection Doctor tells me under smtp.mac.com:budsteetle "Could not connect to this SMTP server. Check your network connection and that you entered the correct information in the Account preferences." I have made not changes in my account, so this appears to be an Apple problem. I can send mail OK through MobileMe on my old .Mac account. Ideas? Usually, the Outbox empties eventually, so far it has been 1/2 a day.
    thank you...

    Hi Bud, and a warm welcome to the forums!
    I saw this earlier, but hoped a Mail expert would drop by, or at least somebody that liked the dot mc service!
    Might see this thread...
    http://discussions.apple.com/thread.jspa?threadID=1359604
    And if you can interpolate, this Leopard doc...
    http://support.apple.com/kb/TS1307?viewlocale=en_US

  • Could not connect to this SMTP server

    Could not connect to this SMTP server. Check your network connection and that you
    entered the correct information in the Account preferences.
    Mail can connect to the internet. My server is Verizon DHL. I restarted my Modem and I still can send mail. I also checked the outgoing mail settings and everything was OK. I still can't send mail but can receive. Is this a mail problem or a Verizon problem?
    Thanks,
    Rich

    Change your port for the SMTP-server (not POP3 or IMAP!) from 25 to 587 (or vice versa, if it's already on 587). If SSL is enabled, try disabling it temporary for testing.

  • Issue in creating Database Connection to HFM Application through workspace

    Hi,
    This is a fresh installation. We are trying to create a new database connection in workspace for HFM Application.
    When i click on the Application selection icon, it gives me the below error message,
    *"Error connecting to database connection nasbyphyp03: Error: Error getting CSS support information for driver* HsvAdmDriver*".*
    I tried re-installing the HsvAdmDriver, but still the problem persists. (nasbyphyp03 is the server name)
    But, i am able to access HFM Application from workspace and smartview.
    Please advice.
    Thanks,
    Siva

    Can anyone suggest me the solution ???
    We are struck with this and unable to process any Reports
    Thanks,
    Siva

  • How to configure database connectivity in OC4J App server.

    Hi,
    I am working on Oracle ESB flows. I have the flow inserting rows into database table using database connection that I have defined. I havent set up connection settings in OC4J EM console.
    I dont wonder when JDeveloper is inserting rows into tables, as connection is explicitely defined in JDeveloper.
    Now I login to EM enviroment and click on Home, click on Web Services tab, and when I use this flow as a Web Service end point and feed values through the form that it provided, it also works. But since I havent defined any connection properties in App Server explicitely, I wonder where is it getting connection properties(JNDI name) from.
    I want to configure some settings in Testing Environment and am kind of stuck at this point.
    Thanks,

    Hi.
    When you don't have JNDI configured, OC4J uses the design time connection defined in the Adapter's WSDL. Look for the following description in your Adapter WSDL:
    <!-- Your runtime connection is declared in
    J2EE_HOME/application-deployments/default/DbAdapter/oc4j-ra.xml
    These 'mcf' properties here are from your design time connection and
    save you from having to edit that file and restart the application server
    if your JNDI is missing.
    These 'mcf' properties are safe to remove.
    -->
    Now, for JNDI configuration, you can use the SOA Suite tutorial as a reference:
    http://download.oracle.com/docs/cd/B31017_01/core.1013/b28937/setting_up.htm#CIHBHEFC
    There you can find the steps to create a connection pool, data source, etc.
    Denis

  • Creating a database with Sun Java Application Server 9

    I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output:
    D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>asant database
    Buildfile: build.xml
    env-user:
    prop-user:
    set-user:
    env-password:
    prop-password:
    read-password:
    set-password:
    set-j2ee:
    create-jdbc:
    set-j2ee:
    asadmin:
    [echo] asadmin.bat create-jdbc-resource user admin password password --
    connectionpoolid PointBasePool --enabled=true jdbc/Agency
    [exec] Usage: create-jdbc-resource [--terse=false] [--echo=false] [--intera
    ctive=true] [--host localhost] [--port 4848|4849] [--secure | -s] [--user admin_
    user] [--passwordfile file_name] --connectionpoolid id [--enabled=true] [--descr
    iption text] [--target target(Default server)] jndi_name
    [exec] CLI193 Password option "password" is not allowed on the command line
    . Please use --passwordfile option or asadmin login command.
    set-j2ee:
    asadmin:
    [echo] asadmin.bat list-jdbc-resources user admin password password
    [exec] Usage: list-jdbc-resources [--terse=false] [--echo=false] [--interac
    tive=true] [--host localhost] [--port 4848|4849] [--secure | -s] [--user admin_u
    ser] [--passwordfile file_name] [target (Default server)]
    [exec] CLI193 Password option "password" is not allowed on the command line
    . Please use --passwordfile option or asadmin login command.
    set-dbpath:
    BUILD FAILED
    D:\original\CaseStudy-2-5\CaseStudy\common\targets.xml:87: D:\Sun\SDK\pointbase\
    lib not found.
    Total time: 2 seconds
    D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise>
    I've checked and there is no Sun\SDK\pointbase folder. The book was written for SDK 1.4 and I believe another application server. There is also a Java program that attempts to create it with jdbc. Its output looks like this :
    D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise\classes>java CreateAgency
    java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
    java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at CreateAgency.main(Unknown Source)
    D:\original\CaseStudy-2-5\CaseStudy\Day02\exercise\classes>
    I am not conversant enough to discuss the corrections for the ANT script but I'm reasonably certain the Java program could work if I had the right strings in these lines.
    // PointBase
    private static final String driver = "com.pointbase.jdbc.jdbcUniversalDriver";
    private static final String protocol = "jdbc:pointbase:server://localhost/sun-appserv-samples,new";
    private static final String user = "pbPublic";
    private static final String password = "pbPublic";
    Can anyone help me with the correct driver and protocol?
    I am using the latest download version SDK JavaEE5
    the entire java program looks like this:
    import java.sql.*;
    public class CreateAgency {
    // Cloudscape
    //private static final String driver = "COM.cloudscape.core.RmiJdbcDriver";
    //private static final String protocol = "jdbc:cloudscape:rmi:Agency;create=true";
    //private static final String user = "";
    //private static final String password = "";
    // PointBase
    private static final String driver = "com.pointbase.jdbc.jdbcUniversalDriver";
    private static final String protocol = "jdbc:pointbase:server://localhost/sun-appserv-samples,new";
    private static final String user = "pbPublic";
    private static final String password = "pbPublic";
    public static void main(String[] args) {
    Connection conn=null;
    Statement s=null;
    try {
    Class.forName(driver);
    System.out.println("Loaded driver: "+driver);
    conn = DriverManager.getConnection(protocol,user,password);
    System.out.println("Connected to: "+protocol);
    conn.setAutoCommit(false);
    s = conn.createStatement();
    System.out.println("Dropping exisiting BMP tables...");
    try {s.execute("drop table ApplicantSkill");} catch (SQLException ex){}
    try {s.execute("drop table Applicant");} catch (SQLException ex){}
    try {s.execute("drop table JobSkill");} catch (SQLException ex){}
    try {s.execute("drop table Job");} catch (SQLException ex){}
    try {s.execute("drop table Matched");} catch (SQLException ex){}
    try {s.execute("drop table Customer");} catch (SQLException ex){}
    try {s.execute("drop table Location");} catch (SQLException ex){}
    try {s.execute("drop table Skill");} catch (SQLException ex){}
    System.out.println("Dropped tables");
    System.out.println("Creating new tables...");
    s.execute("create table Skill(name varchar(16) CONSTRAINT pk_skill PRIMARY KEY (name), description varchar(64))");
    s.execute("create table Location(name varchar(16)CONSTRAINT pk_location PRIMARY KEY (name), description varchar(64))");
    s.execute("create table Applicant(login varchar(16) CONSTRAINT pk_applicant PRIMARY KEY (login), name varchar(64), email varchar(64), summary varchar(512), location varchar(16), CONSTRAINT fk_location FOREIGN KEY (location) REFERENCES Location(name))");
    s.execute("create table ApplicantSkill(applicant varchar(16), skill varchar(16), CONSTRAINT fk_applicant FOREIGN KEY (applicant) REFERENCES Applicant(login), CONSTRAINT fk_skill FOREIGN KEY (skill) REFERENCES Skill(name))");
    s.execute("create table Customer(login varchar(16) CONSTRAINT pk_customer PRIMARY KEY (login), name varchar(64), email varchar(64), address1 varchar(64), address2 varchar(64))");
    s.execute("create table Job(ref varchar(16), customer varchar(16), description varchar(512), location varchar(16), CONSTRAINT pk_job PRIMARY KEY (ref,customer), CONSTRAINT fk_customer FOREIGN KEY (customer) REFERENCES Customer(login), CONSTRAINT fk_location FOREIGN KEY (location) REFERENCES Location(name))");
    s.execute("create table JobSkill(job varchar(16), customer varchar(16), skill varchar(16), CONSTRAINT fk_job FOREIGN KEY (job,customer) REFERENCES Job(ref,customer), CONSTRAINT fk_skill FOREIGN KEY (skill) REFERENCES Skill(name))");
    s.execute("create table Matched(applicant varchar(16), job varchar(16), customer varchar(16), exact boolean, CONSTRAINT fk_job FOREIGN KEY (job,customer) REFERENCES Job(ref,customer), CONSTRAINT fk_applicant FOREIGN KEY (applicant) REFERENCES Applicant(login))");
    System.out.println("Created tables");
    System.out.println("Inserting table records...");
    s.execute("insert into Location values ('London','London UK')");
    s.execute("insert into Location values ('Washington','Washington DC, USA')");
    s.execute("insert into Location values ('Verona','Verona, Renaissance Italy')");
    s.execute("insert into Location values ('Wessex','Wessex, Kingdom of England')");
    s.execute("insert into Skill values ('Tree Surgeon','Tree Surgeon')");
    s.execute("insert into Skill values ('Cigar Maker','Cigar Maker')");
    s.execute("insert into Skill values ('Bodyguard','Bodyguard')");
    s.execute("insert into Skill values ('Cook','Cook')");
    s.execute("insert into Skill values ('Lawyer','Lawyer')");
    s.execute("insert into Skill values ('Critic','Critic')");
    s.execute("insert into Applicant values ('juliet','Juliet Capulet', 'juliet@localhost' , 'Dutiful daughter', 'London' )");
    s.execute("insert into Applicant values ('romeo','Romeo Montague', 'romeo@localhost' , 'Dutiful son', 'Wessex' )");
    s.execute("insert into Applicant values ('julius','Julius Caesar', 'julias@localhost' , 'Roman Emperor', 'Washington' )");
    s.execute("insert into Applicant values ('brutus','Marcus Brutus', 'marcus@localhost' , 'Roman Senator', 'Washington' )");
    s.execute("insert into Applicant values ('proteus','Proteus', 'proteus@localhost' , 'Gentleman', 'Verona' )");
    s.execute("insert into Applicant values ('valentine','Valentine', 'valentine@localhost' , 'Gentleman', 'Verona' )");
    s.execute("insert into ApplicantSkill values ('juliet', 'Cook')");
    s.execute("insert into ApplicantSkill values ('romeo', 'Cook')");
    s.execute("insert into ApplicantSkill values ('romeo', 'Bodyguard')");
    s.execute("insert into ApplicantSkill values ('julius', 'Tree Surgeon' )");
    s.execute("insert into ApplicantSkill values ('julius', 'Tree Surgeon' )");
    s.execute("insert into ApplicantSkill values ('brutus', 'Critic' )");
    s.execute("insert into ApplicantSkill values ('brutus', 'Lawyer' )");
    s.execute("insert into ApplicantSkill values ('proteus', 'Lawyer' )");
    s.execute("insert into ApplicantSkill values ('proteus', 'Critic' )");
    s.execute("insert into ApplicantSkill values ('valentine', 'Critic' )");
    s.execute("insert into ApplicantSkill values ('valentine', 'Cigar Maker' )");
    s.execute("insert into Customer values ('george','George Washington', 'george@localhost', 'White House', 'Washington')");
    s.execute("insert into Customer values ('winston','Winston S Churchill', 'winston@localhost', '10 Downing Street', 'London')");
    s.execute("insert into Customer values ('abraham','Abraham Lincoln', 'abe@localhost', 'Springfield', 'Illinois')");
    s.execute("insert into Customer values ('alfred','Alfred the Great', 'alf@localhost', 'Wessex', 'England')");
    s.execute("insert into Job values ('Tree pruner', 'george', 'Must be honest', 'Washington')");
    s.execute("insert into Job values ('Cigar trimmer', 'winston', 'Must like to talk and smoke', 'London')");
    s.execute("insert into Job values ('Theatre goer', 'abraham', 'Should be intelligent and articulate', 'Washington')");
    s.execute("insert into Job values ('Cake maker', 'alfred', 'Should have a good sense of smell', 'Wessex')");
    s.execute("insert into JobSkill values ('Tree pruner','george','Tree Surgeon')");
    s.execute("insert into JobSkill values ('Cigar trimmer', 'winston', 'Cigar Maker')");
    s.execute("insert into JobSkill values ('Cigar trimmer', 'winston', 'Critic')");
    s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Bodyguard')");
    s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Lawyer')");
    s.execute("insert into JobSkill values ('Theatre goer', 'abraham', 'Critic')");
    s.execute("insert into JobSkill values ('Cake maker', 'alfred', 'Cook')");
    System.out.println("Inserted records");
    conn.commit();
    System.out.println("Committed transactions");
    catch (SQLException ex) {
    System.out.println("SQL Exception thrown: "+ex);
    ex.printStackTrace();
    try { conn.rollback(); } catch (Exception e) {}
    catch (ClassNotFoundException ex) {
    System.out.println(ex);
    ex.printStackTrace();
    finally {
    try { s.close(); } catch (Exception ex) {}
    try { conn.close(); } catch (Exception ex) {}
    }

    JavaEE Tutorial has a chapter on security:
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    Usually a no-arg InitialContext() is used, rather than InitialContext(props). For more info, see
    Glassfish EJB FAQ:
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    -cheng

Maybe you are looking for