Help with a database link?

Hiya
In our environment we have two servers for live and two for test. LIVE01 has db links to all other servers and they all work fine. I cannot get the db links up on test and I'm not sure why..
Both systems have global_names set FALSE so i can name the link anything I want. Both systems have identical TNSNAMES files and no SQLNET.ORA
The test systems have database names that do not have a suffice (it's the only significant difference I can find)
LIVE01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = LIVE01.MYDOMAIN.COM)
LIVE02 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = LIVE02.MYDOMAIN.COM)
TEST01 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = TEST01)
TEST02 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = TEST02)
  )I've connected via RDP to each server, and I can tnsping and sqlplus user/pass@tnsname successfully on both servers, to all instances
The command I use in sqlplus to create the link on LIVE01:
CREATE PUBLIC DATABASE LINK live2dblink CONNECT TO user IDENTIFIED BY pass USING 'LIVE02';
CREATE PUBLIC DATABASE LINK test1dblink CONNECT TO user IDENTIFIED BY pass USING 'TEST01';
CREATE PUBLIC DATABASE LINK test2dblink CONNECT TO user IDENTIFIED BY pass USING 'TEST02';
SELECT * FROM ALL_DB_LINKS
PUBLIC     live2dblink.DOMAIN.COM     USER     LIVE02     2011-04-10 01:26:23
PUBLIC     test1dblink.DOMAIN.COM     USER     TEST01     2011-04-10 01:26:23
PUBLIC     test2dblink.DOMAIN.COM     USER     TEST02     2011-04-10 01:26:23SELECT * FROM DUAL@test2dblink ;
DUMMY
XBut if I repeat the relevant parts of the setup on test01 to link to the other 3 databases:
CREATE PUBLIC DATABASE LINK live1dblink CONNECT TO user IDENTIFIED BY pass USING 'LIVE01';
CREATE PUBLIC DATABASE LINK live2dblink CONNECT TO user IDENTIFIED BY pass USING 'LIVE02';
CREATE PUBLIC DATABASE LINK test2dblink CONNECT TO user IDENTIFIED BY pass USING 'TEST02';
SELECT * FROM ALL_DB_LINKS
PUBLIC     live1dblink.DOMAIN.COM     USER     LIVE01     2011-04-10 01:26:23
PUBLIC     live2dblink .DOMAIN.COM     USER     LIVE02     2011-04-10 01:26:23
PUBLIC     test2dblink.DOMAIN.COM     USER     TEST02     2011-04-10 01:26:23SELECT * FROM dual@test2dblink
error: "tns could not resolve service name"
I've run out of other things to check - it's not the "global names must match" issue because that's set false and verified with
SELECT name, value
FROM gv$parameter
WHERE (name LIKE '%link%')
OR (name IN ('global_names', 'dblink_encrypt_login'));
Yep, it's false..
I've seen other errors during my fiddling with various parameters, including "end of file on communication channel" when select * from dual@db_link.. as though the test instance kicked the connection from live but for the past half hour, this "cannot resolve" has been the persistent one..

Try using the full connect string in the database link like this:
CREATE PUBLIC DATABASE LINK test2dblink CONNECT TO user IDENTIFIED BY pass
USING '(description=(address=(protocol=tcp)(port=1521)(host=10.0.0.2))(connect_data=(sid=TEST02)))';

Similar Messages

  • I need Help with the dynamic link feature in CS3

    Hi I was wondering if anyone could help me with an issue I am having? I have the adobe cs3 master collection. Having watched tutorials on the dynamic link feature my version seems not to have the same options as those I have viewed. I wish to send my premiere video creation to encore using dynamic link, however when I click "file" and then "adobe dynamic link" the only options available are about "adobe after effects". I can export to encore however I am only alloowed to export one premiere sequence to one new encore file, I cannot create an encore file and import several premiere sequence into the same encore project. That means currently I can only have an encore creation with one premiere sequence in it, and I have no adobe dynamic link. Any help anyone could offer would be greatly appreciated.

    Thanks very much for that guys but my premiere media encoder only lets me export as: MPEG1, MPEG1-VCD, MPEG2, MPEG2 blu-ray, MPEG2-DVD, MPEG2-SVCD, H.264, H.264 blu-ray, Adobe Flash Video, Quicktime, Real Media, Windows Media. Are any of these formats DV AVI?
    Am I to export my videos direct to encore or save them elsewhere (e.g desktop). It seems that I cannot export sequences from different premiere projects to the same encore project.
    Sorry if any of these questions seem obvious, I am just new to premiere and keen to do things right from the off.
    Many thanks again guys.
    Date: Tue, 24 Nov 2009 19:32:47 -0700
    From: [email protected]
    To: [email protected]
    Subject: I need Help with the dynamic link feature in CS3
    Harm is correct.  For SD DVD, exporting as a DV AVI file from Pr will give you good results.  Encore's Automatic Transcoding will give you maximum quality for the available disc space.
    -Jeff
    >

  • Help with home page link

    Hi
    Does anyone can help me ?
    I created a web and now I am creating a second folder/ file. How can I link this second folder to the home page placed in first folder ?
    Sorry for my English

    Hi Cari
    Tanhks for you help.  This open my mind, you mean  I need to have two website to this ?
    I ask you this because I have only one website. the acces to my site is only through customer site. I mean I give him the right link  (one link for Company A and another link for company B, both coming from site), do you understand what I mean?
    The point I do not understan is if I save file web A, as  Web B and then I change page names, master and so on, and the I up load, why does muse overwrite in file A when pages are different name !!!!
    The point is Muse does not allow to copy / paste !!!
    Any idea Cari
    Regards from Buenos Aires
    Felix Cano Montoya
    [email protected]
    El 11/4/2015, a las 23:21, Cari Jansen <[email protected]> escribió:
    Help with home page link
    created by Cari Jansen <https://forums.adobe.com/people/Cari+Jansen> in Help with using Adobe Muse CC - View the full discussion <https://forums.adobe.com/message/7430081#7430081>
    I'm not sure I've got a grasp on the issue you are having but let me give it a try
    Website A is finished and you have uploaded it to the Internet, so it is LIVE.
    You make a copy of Website A, and call it Website B, then make all required changes.
    IF you uploaded Website B, then it is likely you will overwrite Website A. You must instead, upload Website B as a separate Website.
    To publish to a new site:
    Click Publish.
    Then click the expansion triangle left of Options.
    Change Publish To setting to New Site
    fill out rest of required details, and click OK to publish.
    You'll now have two separate web-sites.
    If you need to link between them, use absolute hyperlinks (the full URL).
    Hope this helps.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7430081#7430081 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7430081#7430081
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Help with using Adobe Muse CC by email <mailto:[email protected]> or at Adobe Community <https://forums.adobe.com/choose-container.jspa?contentType=1&containerType=14&container=47 61>
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624 <https://forums.adobe.com/thread/1516624>.

  • Problem with using database link from oracle 7 to oracle 9i

    Hi To Every One
    I have two oracle database oracle 7.3.4.0.1 and oracle 9i 9.2.0.1.0.
    and the tns alias to connect to oracle 9i database is oracle9i and tns
    alias to oracle 7 database is oracle7.I have no problem in connect to
    these database using these tns aliases from either database.The tns
    alias for oracle 7 is available in tnsnames.ora file of oracle9i and
    tns alias for oracle 9i is available in tnsnames.ora file of oracle 7.
    So there is no connection problem from each other.Connection is
    working fine for each other but the problem with database links is
    like this
    Problem:
    when i create database link from oracle9i user or public database link
    from oracle9i for oracle7 user like this
    SQL ORACLE9I >CREATE DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    OR
    SQL ORACLE9I >CREATE PUBLIC DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    The links get created sucessfully but when i write command like
    SQL ORACLE9I> DESC <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7
    I RECEIVE A ORACLE ERROR LIKE
    ORA-12663 SERVICE REQUIRED BY CLIENT IS NOT AVAILABLE ON THE SERVER.
    OR IF MY COMMAND IS LIKE
    SQL ORACLE9I> SELECT <FEILD_NAME> FROM
    <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7;
    I RECEIVE AN ORACLE ERROR LIKE
    ORA-01002 FETCH OUT OF SEQUENCE.
    ORA-02063: preceding line from ORACLE7
    BUT IF I CREATE A LINK FROM ORACLE7 USER FOR ORACLE9I USER
    IT WORKS FINE.
    PLZ HELP ME WHAT IS THE PROBLEM THAT THE LINK FOR ORACLE 7 IS NOT WORKING WHEN
    IT IS BEING CREATED FROM ORACLE9I.
    Thank u.

    Oracle 9.2.0 does not support connectivity to Oracle 7. The newest version that will support this is 9.0.1.

  • I have a problem when update tables with a database link (APEX)

    Hi, I search answers for my problem and I not found a solution. My problem start when I open page with database link statement in APEX. I drop tables and execute this for update the tables in APEX.
    EXECUTE IMMEDIATE 'CREATE TABLE XXXXXXX
    AS
    SELECT A1,A2,A3
    FROM AAA@BBB';
    I use Mozilla Firefox and isn't always updated the tables because it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    In the explorer always show a window only the text "IBMPC/WIN_NT-8.1.0"...
    What is the solution for my problem? I need update this tables.
    Thanks. John.

    It's easy. It doesn't work a database link, on apex, with a pl/sql code or store procedure.
    I saw that many people had the same problem but I don't see a solution.
    As I put up, I want to remove my tables on APEX and copy the table of my Oracle database with the update dates.
    The posts are from the same problem as my English is very bad, it got to help explain the problem.
    I have a page with a pl/sql code. This code in Oracle is correctly.
    For example, with this code I update the table PRUEBAS with the data of TABLEX.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX';
    END;
    But, in this code, I have the problem.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX@DB_LINK';
    END;
    I sometimes get an error. Sometimes it works fine, but half of the tries Apex returns "IBMPC/WIN_NT-8.1.0" in the browser and I am not using an IBM PC or Win NT...
    And i read that In the alert_xe.log file there are a error of core dump... ... :S or that the application return corrupt headers.... Is a problem of versions?
    I used a synonym and I have the same problem.      
    Even if I run the code on SQL COMMANDS (SQL WORKSHOP) it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    The problem is in Mozilla Firefox and in IE.
    I have the OracleXE 10g (Application Express 3.0.1.00.08).
    And the question is.. ... ... ... ... What is the solution? :)
    Thanks.
    John.

  • Need help/info on "database link of same name has an open connection"

    Hello,
    I am trying to create an application on html db (new in html db) to see if I can move data from one database (oracle 9i) say dbdev to another one called dbtest. I want to be able to select the data from html db app and by clicking on a button move them to dbtest ( right now only looking at data from one table ). This is what I have done so far:
    1. created a duplicated table of dbdev into html db with no data.
    2. created package with procedures to
    A. create a database link
    B. delete if there is a record on html db table
    C. go trough a loop (cursor) and get the data from dbdev
    D. drop the database link
    Now, when I do all of the above steps I get an error “database link of same name has an open connection" but when I don’t do the step C. I don’t get this error. So something is wrong in my step C. On my step C, I just open the cursor, do a for loop and insert the records into my html db table.
    Any idea!!!
    Thanks
    More questions to come…..

    never mind, I should not drop the database link with in the procedure.
    thx

  • Ofen() hangs when selecting from a view with a database link.

    We have some old COTS software that recently started causing problems after upgrading our database from 9i to 10g (10.2.0.4) on HP Itanium server.
    The select statment in quesiton hits a view that references a table via a database link. After returning a few rows, the process hangs. Reducing the number of columns in the select statement resolves the problem.
    Any ideas? Note that the full sql statment was working prior to the 10g upgrade.

    One thing to try would be to use SCHEMA.TABLENAME rather than just TABLENAME to refer to the tables.
    Its just a shot in the dark, but hopefully it may help.
    Martin.

  • PHP Help with inherited database site

    Hope someone can help with this, although I might be a bit vague. (But will be happy to post any code that might help.)
    Basically I do a few sites for a company, and everything is coming together nicely moving everything to a new reseller hosting account where everything can site. I'm basically doing some redesign and new database work for them.
    But there's one site I'm basically just trying to move over, that already has a database. I've copied the site onto the new hosting, copied the database across and created a new connection file.
    I must admit the code is all a bit more PHPO heavy than what I'm used to working with. so have run into a problem trying to figure out what data is not displaying due to queries failing. As far as I can tell the connection is working, and the queries have not changed.
    Anyway - the main page is here, where you should be able to click on the furniture images to go to the product page :
    http://www.miradatravelmedia.com/lusty/public_html/index.php
    But when you click through the product page query is failing :
    http://www.miradatravelmedia.com/lusty/public_html/products.php?category=1
    The products page is mostly PHP and looks like this :
    [PHP]<?php
    if (!@empty($_REQUEST["img"])) {
      require_once("../includes/hft_image.php");
      $img = new hft_image($_REQUEST["img"]);
      $img->resize(200,180,"-");
      $img->output_resized("");
      exit;
    $page = "products";
    include("../includes/header.php");
    include("../includes/db_open.php");
    $sql = "SELECT `id`, `name` FROM `categories` WHERE `id` = '" . $_REQUEST["category"] . "'";
    $result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
    $category = mysql_fetch_assoc($result);
    ?>
    <div id="trail"><a href="shop.php">Shop</a> &gt; Lloyd Loom <?php echo $category["name"]?></div>
      <div class="clear" id="divider1"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <h1>Lloyd Loom <?php echo $category["name"]?></h1>
    <?php
    $sql =
      "SELECT * " .
      "FROM `products` " .
      "WHERE `category` = '" . $_REQUEST["category"] . "' " .
      "ORDER BY `order`";
    $result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
    if (mysql_num_rows($result) == 0) {
    ?>
    <p>Coming soon ...</p>
    <?php
    } else {
      $n = 0;
      while ($row = mysql_fetch_assoc($result)) {
        $n++;
    ?>
    <a href="product.php?id=<?php echo $row["id"]?>" class="product"<?php if ($n == mysql_num_rows($result)) echo " id=\"last\""?>>
    <?php
        if ($file = glob("images/products/" . $row["id"] . "_*.*")) {
    ?>
    <img src="img.php?img=<?php echo $file[0]?>&width=200&height=180" alt="<?php echo $row["code"]?>" />
    <?php
        } else {
    ?>
    <div id="no_image">No image found</div>
    <?php
    ?>
    <?php echo $row["code"]?>
    </a>
    <?php
        if (is_int($n / 4)) {
    ?>
    <div class="clear"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <?php
    ?>
      <div class="clear" id="divider2"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <?php
    include("../includes/footer.php");
    ?>[/PHP]
    If anyone could shed any light on what's going wrong still, that would be much appreciated.
    Thanks.

    Iain71 wrote:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''categories' WHERE 'id' = '1'' at line 1
    So it does look a bit odd with the quotes.
    Column names in a SQL query must not be in quotes. The MySQL error message tells you that the SQL syntax error is "near" the section it refers to. In other words, the error is just before that part of the query. Normally, you need to display the whole query to spot the error, but it's obvious in this particular case, because there's a quotation mark after categories, indicating that you've put the column name in quotes. Anyway, you've solved that problem by using the version I suggested.
    I still haven't managed to establish where this vat.php file is - is there any explanation for it not being visible on the original hosting server where the site is working? And could it have anything to do with the query not working?
    No, it has nothing to do with the query not working, and the reason you can't see it on the live site is because there's no error. The error message on your test site tells you exactly where to look for the problem. The file vat.php is included by header.php on line 19. Either vat.php isn't on your server, or the code on line 19 of header.php is pointing to the wrong location.

  • Same sql query with multiple database links

    Hi All,
    i want to execute an sql query for a SELECT LIST Item. which should use database links in it's query.
    i'm having a list of database links in the region. say :LOC which is having 10 items each linking to different databases.
    i want to use following query for another item in same page.
    select customer_name from working_lines@:LOC where
    phone_no:phone_no
    can i do this.
    Thank you All.

    What we have done before is to create a report based on a PL/SQL procedure that returns a SQL statement.
    The PL/SQL code grabs the "selected" database link from :LOC and parses the SQL QUERY you want to execute replacing some token (like [LINK]) with '@DBNAME'.
    Lets say your SQL statement is coded like this:
    mySQL := 'SELECT cust_name FROM working_lines[LINK] where phone_no = :Phone;'
    Then all you would have to do to replace '[LINK]' with the proper DB alias would be:
    mySQL := REPLACE(mySQL, '[LINK]', '@'||:LOC);
    and then return the new SQL ...
    if :LOC has something like 'V10GPROD' your SQL would look like :
    SELECT cust_name FROM working_lines@V10GPROD where phone_no = :Phone;
    The beauty of this is that you can also include a "null" option that means the select statement will be executed on THIS database...
    Doug

  • Help with local database

    hye...
    i have some problem with mySQLite database.i have this code
    for my application (in attachment).when you clik the load button,it
    will load a text file on the desktop directory.when you click the
    filter function it will split the text file according to an array
    that i have specified.
    the text file consist of some data like this:66.249.71.54 - -
    [10/Oct/2008:03:31:01 +0800] "GET
    /mod.php?_call=Kalendar&day=2014-05-09 HTTP/1.1" 200
    66.249.71.54 - - [10/Oct/2008:03:31:57 +0800] "GET
    /KERIAN%20ENG/Towns/Main_Town.htm HTTP/1.0" 404
    i have created a database on my desktop using one tool that i
    have downloaded and point to that database.
    the probllem now is,i want to store the "200" only strings
    into the database.strings other than "200" will be not stored in
    the database.can u show me how to do this..
    i hope you can understand what i want...
    thanks for your time..

    ty for your reply
    my boss was dead set to make it work so we get down to it.. he says that this particular conf was now soppurted by oracle (dont think so), but well we modified the realese and now we have the vm server in the box with the vm manager and cam working..
    now i what to discover the server and throws this error
    OVMAPI_4010E Attempt to send command: discover_hardware to server: ovm1.grtn.cfe.gob.mx failed. OVMAPI_4004E Sync command failed on server: 10.0.2.210. Command: discover_hardware, Server error: org.apache.xmlrpc.XmlRpcException: <type 'exceptions.Exception'>:ERROR 0 @ 730 parse_multipath_conf_file() ERROR: /etc/multipath.conf could not be read !?! ERROR 1 @ 372 fill_blkDevInfo_scsi_device() blkdev 'dm-0' bad devLink [../devices/virtual] !?! Runtime errors occured [2] [Tue Jan 20 05:58:32 CST 2015] [Tue Jan 20 05:58:32 CST 2015]
    this is in the vm manager 3.3.1 console
    try to check the etc/multipath.conf and its not there and i have no idea why..

  • Button help with asp database in dreamweaver

    Hey i have a page that has an iframe inside it with 2 menu's
    side by side with buttons in between to move items from one menu to
    another and i have them set with javascript to move back and forth
    works great only problem is its also supposed to update to the
    database as well and i used the update command feature in
    dreamwaver and i set it up but its still not working if i post my
    code can someone help me?

    If you're good with Flash and Action Script you could build a custom player.  Otherwise, pick-one from the links below. Some are free, some are not.
    Coffee Cup Video Player -- (supports playlists)
    http://www.coffeecup.com/video-player/
    Video LightBox --
    http://videolightbox.com/
    WWD Player -- supports playlists
    http://www.woosterwebdesign.com/flvplayer/
    Wimpy Rave -- supports playlists
    http://www.wimpyplayer.com/index.html
    JW Player --
    http://www.longtailvideo.com/
    FlowPlayer --
    http://flowplayer.org/
    YouTube --
    http://code.google.com/apis/youtube/getting_started.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • Help with searching database

    good morning.... could someone please help me with some coding for the following program... i need a text box that i can enter a customers name into that then will search the database and display the appropriate record.. i have written the following code for displaying the whole database but am having trouble with the text box and the searching of the database if anyone could point me to some helpfull links or anything else that would be great.. thanks..
    CODE SO FAR
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class customer extends JFrame {
    private Connection connection;
    private JTable table;
    public customer()
    String url = "jdbc:odbc:Info";
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection(url);
    catch (ClassNotFoundException cnfex){
    System.err.println(
    "Failed to load JDBC/ODBC driver.");
    cnfex.printStackTrace();
    System.exit(1);
    catch(SQLException sqlex){
    System.err.println("Unable to connect");
    sqlex.printStackTrace();
    getTable();
    setSize(450,200);
    show();
    private void getTable()
    Statement statement;
    ResultSet resultSet;
    try{
    String query = "Select * from custDetails";
    statement = connection.createStatement();
    resultSet = statement.executeQuery(query);
    displayresultSet(resultSet);
    statement.close();
    catch (SQLException sqlex){
    sqlex.printStackTrace();
    private void displayresultSet(ResultSet rs)
    throws SQLException
    boolean moreRecords = rs.next();
    if(!moreRecords){
    JOptionPane.showMessageDialog(this,
    "ResultSet contained no records");
    setTitle("No records to diaplay");
    return;
    setTitle("Customer Details Table from Customer");
    Vector columnHeads = new Vector();
    Vector rows = new Vector();
    try{
    ResultSetMetaData rsmd = rs.getMetaData();
    for(int i=1; i<=rsmd.getColumnCount();++i)
    columnHeads.addElement(rsmd.getColumnName(1));
    do{
    rows.addElement(getNextRow(rs, rsmd));
    }while (rs.next());
    table = new JTable(rows, columnHeads);
    JScrollPane scroller = new JScrollPane(table);
    getContentPane().add(
    scroller, BorderLayout.CENTER);
    validate();
    catch (SQLException sqlex){
    sqlex.printStackTrace();
    private Vector getNextRow(ResultSet rs,
    ResultSetMetaData rsmd)throws SQLException
    Vector currentRow = new Vector();
    for (int i=1; i<rsmd.getColumnCount();++i)
    switch(rsmd.getColumnType(i)){
    case Types.VARCHAR:
    currentRow.addElement(rs.getString(i));
    break;
    case Types.INTEGER:
    currentRow.addElement(
    new Long(rs.getLong(i)));
    break;
    default:
    System.out.println("Type was:"+
    rsmd.getColumnTypeName(i));
    return currentRow;
    public void shutDown()
    try{
    connection.close();
    catch (SQLException sqlex){
    System.err.println("Unable to disconnect");
    sqlex.printStackTrace();
    public static void main(String args[])
    final customer app = new customer();
    app.addWindowListener(
    new WindowAdapter(){
    public void windowClosing(WindowEvent e)
    app.shutDown();
    System.exit(0);
    }

    what is it that you actually want to do and what errors are u getting.
    cheers

  • Help with iTunes database and Time Machine after Lion clean install

    I did a clean install of OS X Lion and think I've given myself problems with my Snow Leopard Time Machine backup and with my iTunes Library database files.
    My iMac (2007) had become very sluggish so I opted for a clean install.  Before the install of Lion my Snow Leopard 10.6.8 internal 1TB HD was at about  600GBs.  I was using Time Machine to backup to an external 1TB drive.  I had my iTunes 10.?  library on the same drive.
    For the Lion install I partitioned my internal 1TB HD into two partitions - a 250GB Lion boot partition and the rest for Lion data files.
    Now I  have two problems - 1.  I can't  work out how to re-connect my Time Machine backups, since they were related to a much bigger original drive, and 2.  I can't seem to find my iTunes database files.
    I also don't want to restore any application files at this stage, as I'm determined to do a fresh install of only the applications I need as I go along, and hopefully  avoid the issues of sluggishness I had with Snow Leopard.
    I have all my iTunes files in their pre-Lion external HD folder, but that folder does not seem to  have the iTunes Library.XML or iTunes Library files.  I didn't delete them so I'm hoping they were in my iTunes folder on my SL boot drive.  But that drive was deleted during the install, so I'll be depending on Time Machine to restore the database.
    Can anyone suggest a way to deal with Time Machine for my Lion install, and a way to restore my iTunes database?  I'd like to keep as much of the Snow Leopard Time Machine data as I can, while continuing to do Time Machine backups from my Lion installation.
    Anyone know where iTunes stores those database files, if not in the external drive iTunes folder? Spotlight search doesn't find the files, but is there a way to search my old Time Machine backups without having the Time Machine backups folder re-connected in Lion?
    Thanks.

    My iTunes folder is organised like this if it helps:
    And iTunes uses them from the Prefrences like this:
    Regards,
    Colin R.

  • Help with a database view/table

    Hi,
    I have seperate oracle9i database on one machine (UNIX).
    Myview view has poor performance in dbtest, but it has good performance in dbdev.
    Both DBs are having relatively similar configuration.
    When I set the autotrace on I realized the indexes are in place on both databases.
    But it takes 2 times more to query dbtest than dbdev.
    Here is the difference when I query both views and the autotrace is on:
    SELECT id from Myview; on DBTEST:
    Statistics
    105 recursive calls
    0 db block gets
    83147 consistent gets
    456 physical reads
    0 redo size
    2777 bytes sent via SQL*Net to client
    400 bytes received via SQL*Net from client
    10 SQL*Net roundtrips to/from client
    4 sorts (memory)
    0 sorts (disk)
    122 rows processed
    SELECT id from Myview; on DBDEV:
    Statistics
    105 recursive calls
    0 db block gets
    42537 consistent gets
    267 physical reads
    0 redo size
    3601 bytes sent via SQL*Net to client
    414 bytes received via SQL*Net from client
    12 SQL*Net roundtrips to/from client
    4 sorts (memory)
    0 sorts (disk)
    157 rows processed
    How can I identify where the problem is? Why "consistent gets" and "physical reads" parameters are about 2 times in DBTEST. I believe this is why I have poor performance in DBTEST.
    Could someone give me a clue on how to idetify the issue?
    Thanks

    "I have seperate oracle9i database on one machine (UNIX)."Correction: "I have two seperate oracle9i database installed on one machine (UNIX).
    Can anyone help me with this? If you need more infor let me know.
    Thanks in advance.

  • Help with a database template - Desktop Product Inventory Template

    Hello Developers,
    I'm trying to develop a database to track purchase orders, supply levels, and supplies issued (with reports). I've been working with the MS Access template called "Desktop Product Inventory", but it has more functionality than I need (i.e. shipping,
    sales, invoicing). This template is almost exactly what I'm looking for.
    I've tried removing the fields I don't need, but I encounter errors everytime. Frustrated, I created a new database by studying and copying the format of the template. I have the general structure of the database setup with tabs, but I'm completly lost when
    it comes to formatting/coding the database. I'm not sure what needs to be done in order to recreate the functionality from the original template.   
    Unfortunately, I must admit that Access is my least favorite and used MS application.
    So, my questions are:
    1.) Does anyone know of an "effective" way to edit the Desktop Product Inventory template and maintain functionality?
    OR
    2.) Would someone mind taking a look at my database and giving me feedback? It's essentially just the layout  and what I want the database to show.
    Any and all help is appreciated, thanks for reading!

    The Microsoft template apps have a lot in them - which is why they are particularly difficult to modify by the novice - so don't feel bad. 
    A database that does  Inventory, shipping, sales, invoicing - is going to be complicated inherently, and is really a matter of development familiarity and experience.

Maybe you are looking for