Host name in the getConnection statement.

HI,
I am trying to use JDBC to access Oracle database. I used the following statements to register the driver and get the connection:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:test","SYSTEM", "manager");
I have the database called test. I can compile the code correctly, but when I run it, it says "Invalid Oracle URL specified". I am not sure what to use for the host name. I checked the listener.ora, and the port number is 1521. I have the oracle8.1.7 installed on my windows2000, so I believe it is running as a windows service. Can anybody tell me what hostname to use? Thanks a lot.

I tried to add the statement to the init.ora file which is referenced by the inittest.ora file, and the error message changed to the following: (By the way, am I supposed to modify anything in order to use JDBC, or it should be fine after it has been installed?) Thanks.
Exception in thread "main" java.sql.SQLException: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.O3log.receive1st(O3log.java:428)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:248)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:36
5)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at JDBCExample.main(JDBCExample.java:10)

Similar Messages

  • Changing the host name of the server - impact on old Urls

    All,
    We are in the process of moving data centre and as part of this the host names of the BW servers will be changed and pointing to the new IP address, how and what configuration at BW server level to make sure all web reports points to the new host name when the url is generated.
    Thanks

    looked at the note 805344 and that helped me to understand...

  • Getting the host name in the email subject line

    I am running SCOM 2012. Is there a way to have the host name of the server in the Subject line of an email?

    As alerts dont always have a servername included. ie Alerts usually have the name of the server or source included in Source or Path you might want to include both in the subject.
    Here is what we use but you can add the lines found in the body to the subject:
    Source: $Data[Default='Not Present']/Context/DataItem/ManagedEntityDisplayName$
    Path: $Data[Default='Not Present']/Context/DataItem/ManagedEntityPath$
    Cheers,
    Martin
    Blog:
    http://sustaslog.wordpress.com 
    LinkedIn:
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Retrieve the host name behind the radware url

    Hi,
    Is it possible to retrieve the host name behind the radware url in BI Publisher template?
    Thanks, R.

    Hi,
    Did you maintained the entry in below format
    12.123.23.23        srstfdf        srstfdf.shouse.com
      in hosts file. If it is already maintained in the above format. then check the error if it is DNS related maintain the entry in DNS.
    thanks,
    madhu

  • Change IP and Host name of the server

    Hi,
    Db :11.2.0.3
    Os:Aix6
    OS team are going change IP address and host name of the server which has ASM and DB.
    What are the things we need to follow for this?
    Thanks & Regards,
    VN

    OS team are going change IP address and host name of the server which has ASM and DB.
    What are the things we need to follow for this?1. TNSNAMES.ORA files everywhere
    2. LISTENER.ORA on server
    If there are thin JDBC clients, change IP/hostname in their connection URLs.

  • HT201320 I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. H

    I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. Help!!

    Yahoo's servers are notoriously unreliable. Use the "Yahoo" account type when setting it up. If it doesn't work, and you are positive the credentials are correct, wait a while and try again.
    While you're waiting, set up a free gmail or iCloud email account.

  • How do I "scan" my LAN and find the host name of the server computer?

    I need to scan my LAN to find out the IP and host name of the computer in which is waiting for client acceptance because the server side of my program is not always on the same computer. Therefore, the IP and host name of my server is not final and can be placed on any computer on my network with over 50 connected computers. How might I check to see which computer is waiting for a client?
    EDIT: I need the host name only, disregard IP
    Thanks!

    watwatacrazy wrote:
    jwenting wrote:
    Peter__Lawrey wrote:
    If you know the port you can try to connect to each of the machines in turn.the people getting firewall warnings about intrusion attempts would just love that, as would the network admins whose network you're clogging with traffic (imagine several hundred clients doing that all day long, let alone tens of thousands).
    If they are all one the same subnet you can use the IP addresses.Which you don't necessarilly all know. Or do you propose just sweeping through all possible IP addresses in the subnet's range? That would be a sure trigger for your network admins to immediately kick you out.
    This should take a few seconds at most.Until the automatic safeguards kick in and you're thrown off the net :)In that case, what would you suggest?Not to bother. The server address should be part of the application configuration, not guessed at runtime.

  • How to set dynamic host name in the URL of a URL iView?

    Hello,
    I am using a standard URL iView that points to some J2EE app I've written and deployed on the same server.
    I would like to set the host name to be a dynamic one, this way I won't need to change the iView URL when transporting it from one portal to another. As far as I know the system for a URL iView only controls authorizations but cannot replace the full URL set in the iView.
    Any idea who can this be achieved?
    Roy

    Hi Mrityunjay,
    forced URL at runtime will require me to call the URL iView from another iView that I will need to code (setting the URL in the Request object). If I did all this I might as well call it from this iView already.
    I would like to do it with no further developments. I would have thought that SAP has constants that can be plugged in the URL for this type of thing, i.e. $hostname...
    Rgds,
    Roy
    Edited by: Roy Cohen on Aug 21, 2008 4:03 PM

  • How to get host name in the workflow?

    Hi,
       I've a requirement where I need to get CQ Inbox url (http://<hostname>:<port>/inbox) in my custom workflow process. I thought of configuring url to some node and retriving from there.. but It's not the good approach as host name will be different for differnt CQ environments. So what is the best way of getting inbox url?
    Env: CQ 5.6
    Thanks
    Siva

    Yep Justin, If the configuration is wrong, any link generated would also be wrong.. I mean, default configuration will be some thing like..
    I mean, I can change those configurations as per my instance host name, right?
    Example: my instance's host url is:  mytest:1501
    So I would like to update the same in configurations ..

  • Getting host name of the remote client using getRemoteHost() --Problem

    Hi everybody
    Does anyone know how I can get the Host name out of the request ? I just get IP address which I do not need at all , any suggestion ?
    Many thanks
    Arash

    If it has a name then
            InetAddress addr = InetAddress.getByName("212.58.224.123");
            System.out.println(addr.getHostName());

  • How can i pass a variable instead of a table name in the Select statement.

    Dear all
    how can i pass a variable instead of a table name in a select statement ?
    Example :-
    Begin
    P_get_procedure_tname (aap_name,otable_name);--It will take an application name and will return a table name
    Select col1 into ocol1
    from  ---- here i want to pass the variable OTABLE_NAME
    End;How can i pass this ?

    Hi,
    You can use dynamic sql.
    EXECUTE IMMEDIATE 'SELECT COL1 INTO ' || OCOL1 || ' FROM " || OTABLE_NAME;
    {code}
    cheers
    VT                                                                                                                                                                                                                                                                                                   

  • Assigning a host name in the router

    How do you assign a host name to a device that was discovered with a static IP address?
    Router is a mi424wr-gen3i .

    This thread may help you:
    http://forums.verizon.com/t5/FiOS-Internet/Static-IP-Address-for-NAS-Network-Attached-Storage/m-p/57...
    Enjoy!
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Servername and virtual host name is the same - how to handle this

    Hi,
    I set up a server with the hostname yxzwiki.org
    In the Server app under Websites this domain points to /Sites
    In this /Sites directory is all my content (several Wikis) and also the phpmyadmin.
    What is the issue now?
    I want this xyzwiki.org not only as the hostname but as a virtual host as well.
    So I have the following entry in the corresponding conf file.
    <VirtualHost *:80>
      ServerName xyzwiki.org
      ServerAdmin [email protected]
      DocumentRoot "/Sites/xyzwiki/xyzenwiki"
      DirectoryIndex index.html index.php
    How can I handle this?
    xyzwiki.org shows the content of /Sites/xyzwiki/xyzenwiki but I cannot e.g. get access to http://xyzwiki.org/phpmyadmin
    Any ideas?
    Thanks
    Tristan

    I guess I have talk more about this issue that people got the chance to help
    xyz.org is the host name of our server.
    The intention of this server is to run a wiki via mediawiki.
    When we first set up the server we planned to have three language versions and the corresponding wikis were found on the server under
    en.xyz.org for the English version
    de.xyz.org for the German and
    es.xyz.org for the Spanish version
    But then we decided ONLY to concentrate on the English version and so prefix en became deprecated and we only want the domain xyz.org that shows the English Wiki.
    The English wiki is on our server under /Sites/xyz-wiki/xyz-enwiki
    In the Server.app I defined /Sites as the server website and I have a virtual host for xyz.org AS WELL that defines /Sites/tangowiki/tangoenwiki.
    This seems to overrule the entry in the server.app as xyz.org shows the content of /Sites/xyz-wiki/xyz-enwiki
    As I have other "services" as well under /Sites, e.g. phpmyadmin it is not possible for me with xyz.org/phpmyadmin to get to this service.
    So what I am looking for is a trick that I can keep the /Sites directory as the main directory for xyz.org. I was thinking of a symlink for the index.php from /Sites/xyz-wiki/xyz-enwiki and to remove the virtual host entry but this does not work. Any other ideas.
    Cheers
    Tristan

  • Run time Column Name in the Select Statement

    Hi there,
    I face problem while writing sql statment for report in the Oracle reports.
    The prom is I want to bound the where clause column name with the value stored in a variable e.g.
    Select * from emp
    where Column_Name = 'XYZ' ;
    where the variable Column_Name have different values at different times, e.g.
    At a time the value of Column_Name is Dept then
    Select * from emp
    where Dept = 'XYZ' ;
    At other time value of Column_Name is City then
    Select * from emp
    where City = 'XYZ' ;
    Waiting for the response .
    Regards,
    Hafeez

    Hi,
    U can use lexical parameters for the solutions.U must be aware of it, but still i describe how to work it out.
    1)In your datamodel in object navigator create a parameter under User parameter node.Name the parameter, for eg. p_clause.
    set data type of parameter to character.
    2)write a select query eg.
    select * from emp &p_clause; --(THIS IS THE PARAMETER WE CREATED ABOVE)
    3)Now run your report
    Now in your parameter form pass the value for p_clause parameter.
    eg: where name='JACK';
    or
    where city='NEWYORK';
    or where deptno=10;
    But do it in steps as above mentioned.
    Do tell me if it works or not via mail on [email protected]
    Enjoy.......
    navneet jain
    [email protected]

  • How to use a table name in the select statement using a variable?

    Hi Everybody,
                       I got a internal table which has a field or a variable that gets me some tables names. Now I need to retrieve the data from all these tables in that field dynamically at runtime. So could you suggest me a way out to use the select query which uses this variable as a table ?
    Regards,
    Mallik.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

Maybe you are looking for