How connect to database from javascript

Hello friends
This is sudhakar, working as a developer in indian based company, present we are developing one web based application for this purpose i am creating one dynamic menu.
my problem is:
how can i connect to the database from javascript, for this purpose is there any configuration please reply and also send me sample code on for creating dynamic menus depending on the database values using javascript
regards.
sudhakar
[email protected]

Copy the code in to new HTML File then open the file with IE
<html>
<SCRIPT LANGUAGE=javascript>
<!--
function ConDB()
     var conn = new ActiveXObject("ADODB.Connection") ;
     var connectionstring="Provider=SQLOLEDB;Password=;User ID=;Initial Catalog=;Data Source=;"
     conn.Open(connectionstring);
     var rs = new ActiveXObject("ADODB.Recordset");
     rs.Open("SELECT * FROM YourTablename ", conn);
     rs.MoveFirst
     while(!rs.eof)
     document.write( yourtablefieldname);
     rs.movenext;
     rs.close;
     conn.close;
}       //-->
</SCRIPT>
<body OnLoad="javascript:ConDB()"></body>
</html>

Similar Messages

  • How to connect oracle database from tuxedo

    Hi,
    How to connect oracle database from tuxedo.
    If any one can help me.
    Regards,

    it depends on configuration your going to choose, there are two ways--
    - Using X/Open standards, for this
    you have to make an entry of Resource manager in $TUXDIR/udataobj/RM file.
    Then in UBBConfig file in GROUPS section u have to set Openinfo.
    It also depend on which database you are going to use.
    In your service now you need to call tpopen() API from tpsvrinit() function.
    - Other possibility is, take an implicit connection using Pro*C or Pro*Cobol whatever platform you are using.
    EXEC SQL Connect ...

  • How to connect informix database from informatica through JDBC instead of ODBC

    How to connect informix database from informatica through JDBC instead of ODBC.

    Hi mate,
    You may get fast reply for this in informatica forums.
    Thanks
    http://mkashu.blogspot.com

  • How to Connect Oracle database from excel

    I have installed oracle 11g on Windows 8 64 bit OS  on my laptop. I have Microsoft excel 2013. I can connect to database from SQL and from TOAD. Now  i want - from excel to connect to database.
    Please guide me the steps.
    Thanks

    Below link may be helpful to you :
    http://khalidali-oracledba.blogspot.in/2013/09/connection-between-ms-excel-to-oracle.html
    And if you are getting 32 bit vs 64 bit ODBC driver issue then :
    https://social.technet.microsoft.com/Forums/office/en-US/2234554e-e93c-438b-990a-6739df19da44/odbc-connection-problem-in-excel-2013-64-bit-windows-8-os-and-x64-processor-oracle-8i?forum=excel
    And still you are not able then post the question in :
    ODBC
    Regards
    Girish Sharma

  • Problem in connecting to database from webdynpro for java

    Hi
    I have a problem in connecting to database from webdynpro application
    I am using oracle 10 express edition as database and was able to connect to database from a java application.But  was unable to connect from a webdynpro for java.
    <b>I guess webdynpro for java uses open sql instead of vendor sql(I looked in the visual admin ,DB is using open sql) so unable to connect to database.Am i right.?</b>
    Do i need to make any settings in the visual admin to make it work?
    How to solve this problem.Please give me pointers
    Thanks
    Bala

    Hi,
    For connecting to Oracle, either you can use the normal JDBC connectivty code directly which is given below :
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    In case you want to fetch data through ejbs, these are the steps to be followed :
    1) Open the J2EE perspective
    2) Create an EJB Module project
    3) Right click on ejbModule, create a new EJB (select your EJB type)
    4) While creating the ejb itself, you can add business methods by clicking ‘Next’ in the UI. Another option is after creating the ejb, write the method in the bean, then select the method from ejb-jar.xml -> <bean name> ->method. Right click and select ‘propogate to local & remote’.
    5) Double click on ejb-j2ee-engine.xml. select your bean and specify a Jndi name for eg: “MyJndi”.
    6) Right click on the EJB project and add ‘classes12.zip’ file (provided by Oracle) to it’s build path. (under libraries tab). Also check the same file under ‘Order & Export’.
    7) Create an Enterprise Application project.
    8) Right click on the EJB module project and select add to EAR project, then select the created EAR project.
    9) Right click on the EJB project, select ‘Build EJB Archive’
    10) Right click on the EAR project, select ‘Build Application Archive’
    11) Open the WebDynpro perspective, open a new project, right click on the project ->properties. Do the following configurations :-
    • Java Build path - select the EJB project from ‘projects’ , check the selected project under ‘Order & Export’
    • Project references – select the EAR project
    • WebDynpro references – select ‘sharing references’ tab, click add & make an entry as : <vendor>/<EAR project name without .ear extension>
    You can find the vendor name under ‘application-j2ee-engine.xml’ file of the EAR project. By default it is ‘sap.com’. So if my EAR project’s name is ABC, my entry would look like ‘sap.com/ABC’
    12) Now the configurations are over and the EJB can be invoked by writing the client code inside the webdynpro component. Like:
    InitialContext context = new InitialContext();
    Object obj = context.lookup("MyJndi");
    MyEJBHome home = MyEJBHome)PortableRemoteObject.narrow(obj,MyEJBHome.class);
    MyEJB mybean = home.create();
    int a = 0;
    a= mybean.add(10,15);
    wdContext.currentContextElement().setSum(a);
    where ‘MyEJB’ is my EJB name and ‘MyJndi’ is my JNDI name
    To connect to Oracle , you can write the usual Java code (given below) as a business methos of the ejb (similar to add() method in the example). And access it like mybean.<businessMethodName>().
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@Oracle_server_ip:Oracle port:SID of the Database","user_name","password");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery("your query");
    Extracted from Re: Webdynpro and Oracle
    http://help.sap.com/saphelp_webas630/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm
    May be of use to understand the VA Conf /people/varadharajan.krishnasamy/blog/2007/02/27/configuring-jdbc-connector-service-to-perform-database-lookups
    Regards
    Ayyapparaj

  • Not able to connect RAC database from client

    Hi there
    Recently I have configured RAC in test environment. version 11.2.0.1. OS Redhat 5.9. Everything seems to be fine except not able to connect rac database from client.  Error is as under :
    C:\Documents and Settings\pbl>sqlplus test1/test1@myrac
    SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 17 14:29:06 2014
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    Enter user-name:
    myrac =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = racdb.testdb.com.bd)
    Please give me your valuable suggestion to  overcome the issue.
    Regards
    Jewel

    user13134974 wrote:
    ORA-12545: Connect failed because target host or object does not exist
    This error means that the hostname or IP address used in the TNS connection string, failed to resolve or connect.
    Your client is making two connections. The first connection is to the SCAN listener. It matches a db instance for your connection request based on service requested, available registered service handlers, load balancing, and so on. It then send a redirect to your client informing it of the handler for that service.
    Your client then does a second connection to this service (a local RAC listener that will provide you with a connection to the local RAC instance). This is what seems to be failing in your case.
    The SCAN listener's redirect uses the hostname of the server that the local listener is running on. Your client needs to resolve that hostname (of a RAC node) to an IP address. This likely fails.
    You can add the RAC node hostnames to your client platforms hosts file. The appropriate action however would be to ensure that DNS is used for name resolution instead.

  • How to create database from .sql file

    how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
    ho to do it..??

    why do you want to do this from java?
    i just don't see the point.
    find your dba and have him/her run it for you

  • Not able to connect to database from Form builer

    Hi ,
    I installed oracle 10 g in my machine and is accessable from SQLPLUS & TOAD.
    In the same drive i installed Form builder, i am getting the below error when i tried to connect DB from form builder.
    ORA- 12154 : TNS : could not resolve service name.
    Kindly do the needfull.

    not able to connect to database from Form builder

  • How To Migrate Databases From Windows 2003 32 bit to windows 2003 64 bit?

    Hi,
    How To Migrate Databases From Windows 2003 32 bit to windows 2003 64 bit?
    Db Version: 10.2.0.2
    Thanks,
    Yusuf

    Also see MOS Doc 403522.1 (How to Migrate Oracle 10.2 32bit to 10.2 64bit on Microsoft Windows)
    HTH
    Srini

  • When connect the Database from Toad , Sqlplus giving the error

    when connect the Database from Toad , Sqlplus giving the error
    recent changes 12.1.1 installatiojn
    Oracle SQL plus encountered a problem and needs to close we are sorry for convenienvce
    Oracle Forms Designner has encountered a probloem and needs to close we are sorry for the convenience
    Thanks & Regards,
    sree

    when connect the Database from Toad , Sqlplus giving the error recent changes 12.1.1 installatiojnHave you tried using the same user via simple sqlplus on the database server or apps tier server itself? Please try the same database user/login on the database server using the sqlplus available on the server itself. See what message do you get. If the the login happens, then try with the tns entry e.g. sqlplus username/password@prod and see if that works on the db server. If both of these conditions work the check where is Toad picking up the tns entry from on the client pc/laptop. If first test fails, then check if the account is locked.
    Hope this helps.

  • How connect to internet from domain created in Hyper-V

    How connect to internet from domain created in Hyper-V
    Host =  Win8 Pro
    Connection to internet done using WI-FI
    Internet seeting
    Home router with secury connection -> cable internet
    Network name set on router = "Mtl2014"
    Host setting
    TCP/IPv4 Seeting for WI-FI ,connected to "Mtl2014"
    Obtain address automaticly
    Obtain DNS server address automaticly
    I can connect and browse internet from host
    In Hyper-V
     1.created 2 private virtual switches SW1 and SW2
     2.installed 2 VM HA1 and DC with Win2012 server eval edition
     3.assigned stations HA1 and DC  to virtual switch SW1
    on Host
    WI-FI network connection
     Sharing->Allow other network to connect.. ->Home network connection vEnthernet (SW1)
    in Hyper-V
     choose Activate windows on  HA1 and DC
     open browser on HA1 and DC ,
     At this point I am able to see and browse and search in google from HA1 and DC
    In Hyper-V
     assined virtual switch SW2 to DC and HA1
     created Domain controler on DC and domain Alex1.com
     TCP/IPv4 Seeting on DC
     IP = 192.165.1.8
     subnet = 255.255.255.0
     default getaway = empty
     Prefered DNS server = 192.165.1.8
     TCP/IPv4 Seeting on HA1
     IP = 192.165.1.11
     subnet = 255.255.255.0
     default getaway = 192.165.1.8
     Prefered DNS server = 192.165.1.8
     added HA1 to domain Alex1.com
    Question
     What seeting on SW2, DC, HA1 and  Wi-FI should I change in order to have access to internet from  Alex1\DC and Alex1\HA1?
    I was planning to use internet to download/install pacthes/updates for windows and sql servers located on Alex1\
    I plan to build 6 more Win 2012 server eval and join then to Alex1\
    Thank you
    Alex

    I see.
    1. 192.168.0.0 addresses are not routable across the public Internet. Even if the whole world knows you're using that space, the information is useless. But if you feel better hiding it, OK.
    2. Internal doesn't allow communications with a physical network either. Only the external type does.
    3/4. Your problem is not really with Hyper-V. It's with IP.
    Your machines are all able to communicate with each other because they're on the same switch and the same subnet. No gateway is required. If you have a computer with an IP of 192.168.1.8 and its subnet mask is 255.255.255.0, then it will be able to communicate
    with any computer on the same switch with an IP of 192.168.1.anything. It's when they need to talk to computers off of that subnet (anything that doesn't fit the 255.255.255 mask) that they have a problem. For that, you need a gateway somewhere. You can't
    use "DC" for the gateway because it's not performing routing services.
    You have two choices.
    One is to use an external switch so that your guests are directly connected into your physical network. That will take over your WiFi adapter, so you'll probably want to set the share option so your Win8.1 box continues to function. Then just use a common
    IP subnet with everything else on your home network.
    The second is to set up a software router. If you are using an internal virtual switch, then this has to be in the Win8 environment. I might be mistaken, but I think that
    Internet Connection Sharing would even work for this. If you are using an internal virtual switch, then your Win8 system should see two (or more) adapters. One of them is the physical adapter (we'll call it wNetAdapter) and one would be the virtual adapter
    (we'll call it vNetAdapter) it uses on the virtual switch. Once you set up ICS, you would have all of your VMs use the IP address that you assigned to vNetAdapter as their gateway.
    Eric Siron Altaro Hyper-V Blog
    I am an independent blog contributor, not an Altaro employee. I am solely responsible for the content of my posts.
    "Every relationship you have is in worse shape than you think."

  • Unable to connect to database from D2K

    Hi,
    GoodDay, This is Ramesh. I have loaded both Oracle 9i & D2K in my PC. But i am getting some error message while trying to connect to database from d2k forms. I entered Usename, Password. The message is..
    ORA-12203: TNS: Unable to connect to destination
    The second time i entered both Username, Password & Database.
    User Name: Scott
    Passwors : tiger
    Database: ORCL9i (SID name)
    please let me know where i am lacking..?
    Regards,
    Ramesh.

    Do you connect when you set username , passwd , database....????
    If you can via another tool , for example sql*plus then simply , copy the particular setting tns alias , you use to connect to this db, from [ORACLE_HOME]\network\admin\tnesanames.ora and paste it to [DEV2000_HOME]\network\admin\tnsnames.ora
    Greetings,
    Sim

  • How to migrate  database from oracle10g to mysql

    how to migrate database from oracle10g to mysql

    Assuming you're actually using any of the features of Oracle at present, this will be an impossible task, since MySql has such narrower set of supported SQL.

  • Getting exception ORA-12705 while trying to connect to database from forms 9i

    Hello All,
    I have installed 9i database and I gave path for oracle home as Oracle_path while installing. then I installed 9i dev suite, Installer forced me to use different Oracle home, so I gave Odev_path as path.
    I have created server alias name from dev suite to Oracle database and I could connect to database from froms 9i. suddenly it started giving me the following exception when I try to connect database from forms 9i.
    ORA-12705 invalid or unknown NLS parameter value specified
    could some one help toresolve the issue.
    Thanks in advance
    Raj

    I have already seen this document and tried it out, but it didn't work. And I have tried out numerous other tips that I have found in different places on the web.
    Is the client installation of any relevance? I notice that this user has a different installation from the one that I have, and that he amongst other things doesn't have sql plus installed.

  • How to find the number of users  connected to database from OS level(Linux)

    Hi All,
    Could anyone know , how to find the number of users connected to database without connecting with sql*plus
    is there any command to find it?
    example we have 10 databases in one server, how to find the number of users connected to particular database without connecting to database(v$session)?
    oracle version:- 10g,11g
    Operating System:- OEL4/OEL5/AIX/Solaris
    any help will be appreciated.
    Thanks in advance.
    Thank you.
    Regards,
    Rajesh.

    Excellent.
    Tested, works as long as you set the ORACLE_SID first ( to change databases )
    ps -ef | grep $ORACLE_SID | grep "LOCAL=NO" | awk '{print $2}' | wc -l
    Thanks!
    select OSUSER
        from V$SESSION
    where AUDSID = SYS_CONTEXT('userenv','sessionid')
        and rownum=1;Best Regards
    mseberg

Maybe you are looking for

  • Sony bravia internet

    Hi, for almost a year i was geting videos on my tv using dongle(wifi adapter for sony). Few days ago it stopped. TV can't get signal from a router any more. I tried to reset, new setup. Nothing works. If anyone has similar problem. Thanks  Solved! Go

  • Hard drive shows up as dig camera card

    One of my external hard drives, no matter what I do (re-mount, restart, reboot, etc) shows up as a digital camera card instead of the normal hard drive. The hard drive functions as normal outside of 1.5 but within Aperture it's treated as a digital c

  • Migrating data from one databaes to oracle?

    is there any way to migrate my data from my old/previous database to oracle db. ie. migrating data from one databaes to another.

  • Keeping track of rows already selected

    Hi.  I'm somewhat a T-SQL noob.  The answer to my question may be obvious, but I just want to see if I have any options.  I need to scan a table for rows where a column contains a certain value, and then send an email to notify users of the resultset

  • Sales Order Status for Delivery.

    Hi Guys, Thanks for answering my previous question. I have been asked to solve another problem for the SD department. How can I find out if a sales order is ready to be delivered? Is there a list display where in I can see all open sales orders and t