JDBC and adapters

I wrote the following code on a VINE
OracleDataSource ods = new OracleDataSource();
ods.setURL("jdbc:oracle:thin:scott/[email protected]:1521/orcl");
Connection conn = ods.getConnection(); 
// Check for the existence of a previous customerID
String selectStmt     = "SELECT * from STEPS " +
     "WHERE (streamID='" + 
     this.customerId +
     "') and (assetid='" + 
     this.eventName +
     "')";    
Statement stmt  = conn.createStatement();
//System.out.println("-- calling SELECT");
//System.out.println(selectStmt);
ResultSet rs    = stmt.executeQuery(selectStmt);
It works fine, except that it's slow exceedingling. I send about 20,000 messages to this code.

I think the problem is that I opened the connection whenever I run a select statement (and later an insert statement).

The server instance goes away after the message has been processed, and I can't save the connection.

Using an adapter in the config.xml file would prevent this opening a new connection each time a message calls this code.

If Yes, I've never done JDBC with an adapter and I do not understand how to use an adapter to use a WHERE clause to select variables, since, in the example I've seen so far, it puts 'SELECT 1 from DUAL' in the config.xml file and does not explain how to get mix have the select interact with variables code or better yet how to get your code to get a connection handle.

Could someone please post an exaqmple of how to use an adapter with JDBC and eventually how get your code to access a connection from the config.xml file handle?

Thank you

Hello

I recommend you to configure your JDBC driver in the config.XML to the server level. Doing it this way will allow you to benefit from the pooling of connection provided by the application server. Here is an example:


StockDs


1
10


JDBC:Derby:
org.apache.derby.jdbc.EmbeddedDriver


databaseName
DB


create
true




Hope that helps.
Seth White

Tags: Fusion Middleware

Similar Questions

  • Difference betweeen JDBC and JRE

    Hello

    What is the fundamental difference between JDBC and JRE?

    JDBC used to connect jdbc (Application users) connections to the database.

    We use a JRE to access forms only... is that correct?

    Please provide details

    -Thank you

    Please see:

    R12 Oracle EBS [458282.1 ID] context variables - Search for jdbc (and feel free to find MOS for more information about each setting, if the description in this doc isn't enough for you)

    Using automatic configuration to manage system Configurations in Oracle E-Business Suite Release 12 [387859.1 ID]

    Thank you

    Hussein

  • Pilot third party JDBC and domain Extension

    Hi everyone, I am using a third-party driver to acess some inherited in my company database. I'm adding them in WebLogic (v. 10.3.3.0) Classpath by setting the EXT_PRE_CLASSPATH in the setWLEnv.sh file. Everything worked well until now, until I had to extend my domain to account for new settings. The Configuration Wizard hangs in the Middle saying: "a fatal error has occurred. This Application will end '. By inspecting the logs, I see the wizard attempted to get my Data Source that uses the third-party driver and could not find the class driver. I would like to know if there is a better way to add the library to the Weblogic classpath or someway to work around this problem in the extension. In my current situation, I have to delete the data source, in the field and reconfigure the data source, which is big trouble!
    Any help would be appretiated! Thank you

    PS: I also tried to add the third-party driver JAR in the CLASSPATH in config.sh file, but unfortunately, the error was the same!

    You can place your jars in the lib of the domain directory.

    WebLogic uses a separate class loader to load classes from the domain's lib directory. This classloader
    is a child of the system class loader and a relative of the Chargers for custom classes application. Classes and
    resources in any file .jar in the directory are automatically available for all applications.

    Note, however, that the lib classloader field does not support the redeployment, dynamic a reload or FastSwap and can not
    refer directly to the code in the application classloaders. But I think that this is not a problem, you just want your
    third driver JDBC to be available for your applications.

  • Cables and adapters

    I know that DVI port on my monitor (W2207h) and the VGA port are analog.

    Now, with that said. If I use a VGA - DVI adapter or vice/verse how that

    convert VGA signal digital digital signal to VGA?  Lets not worry her.

    DVI can also carry as digital analog signals, despite its name. The converter is simply a physical adapter. The monitor and video card pick this up and treats the signal accordingly.

  • Power cord power supply and adapters for series nr9700

    I would like to buy a replacement power supply cord and possibly an adapter for my laptop nr9700.  passing by the parts store is quite expensive but I think 11.25 in freight for a power cord is outrageous.213349 - 001 is the part number for the power supply cord and 432309-001 for the adapter.  Is there something else comparable for the power cord?

    I have a wireless connection and want to move the laptop from one room to the other without constantly by unplugging and plugging it in.

    Or you could just buy it here to 63.99 USD (sale today) - includes sector and power cord adapter and it comes with a 1 year warranty.

    Message edited by Kalt 26/12/2008 11:59
  • How to tell the difference between access through JDBC and direct sql queries through server dimensions

    Hi all

    We use an Oracle 11 g server, the request is sent to the oracle database through different ways, one directly from the server of dimensions and is another method below

    • TDC customer creates a session in the api
    • session of the API sends a request to the application server
    • application server queries the database

    Of course, I see all the sql queries in the oracle database, but what I am interested in is now what queries go directly through the server dimensions and through the API. Please tell me how I can find this information.

    MACHINE, TERMINAL, PROGRAM, MODULE and CLIENT_INFO column in V$ SESSION could give you a clue.

    HTH,

    Lordane Iotzov

  • JDBC and creation of external tables with positions

    Hello

    This could be a trick question or I'm probably going in circles with this one. I know that it is not possible to call the pl/sql command ("together define") using a jdbc connection. Correct me on this one, if I'm wrong ;)

    So what I want because I want to run the following using a CallableStatement stmt:

    -----
    command prompt
    Guest: CREATE TABLE 'TEST_IN '. "" TEST_RECEIPT_EXTERNAL "...
    command prompt

    CREATE TABLE 'TEST '. "" TEST_RECEIPT_EXTERNAL ".
    ('APPLE' VARCHAR2 (8 CHAR)
    , VARCHAR2 (1 CHAR) 'PIE '.
    'RECEPTION' VARCHAR2 (58 CHAR)
    )
    EXTERNAL ORGANIZATION
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY 'TEST_IN '.
    ACCESS SETTINGS
    (records delimited by newline
    fields)
    APPLE position (1: 8) CHAR (8),
    PIE of the post (9: 9) char (1),
    RECEIPT of the post (10: 67) CHAR (58))
    )
    LOCATION
    ("TEST_IN": "FLIP.) FLOP.19760104170600'))
    REJECT LIMIT UNLIMITED
    1 PARALLEL
    /
    -----

    that gives me the expected error:

    Parameter Missing or OUT to index: 1

    Any thoughts on this would be very useful - thanks in advance,
    Sascha

    Use a regular statement. There is no reason to DDL like that with a callable statement.
    You should be OK then.

  • JDBC and ODBC

    run:
    Exception in thread "main" java.lang.NullPointerException
    to InsertDemo. < init > (InsertDemo.java:26)
    at InsertDemo.main (InsertDemo.java:77)
    Result of Java: 1
    BUILD successful (total time: 1 second)

    This is the message that I get when I try to run my Java program to connect to SQL server 2005, I put the user data source in ODBC Data Source Administrator.
    I went on all protocols on the server also as TCP/IP server should listen to connections.
    When I run this code specific to Windows 7 Professional 32-bit operating system, it is fluid, but when I try to run the same version of Windows but 64-bit I get this message with all the same settings at a time. My code is: -.
    import java.sql.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    
    public class InsertDemo extends JFrame implements ActionListener
    {
         JTextField tf1,tf2,tf3,tf4;
         JTextArea ta;
         JButton jb1,jb2;
         Container cp;
         Connection con;
         Statement stmt;
         public InsertDemo()
         {
              cp=getContentPane();
              cp.setLayout(new FlowLayout());
              try
              {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:empdsn");
                   stmt=con.createStatement();
              }
              catch(Exception e)
              {
                   ta.setText(e.toString());
              }
              tf1=new JTextField(20);
              tf2=new JTextField(20);
              tf3=new JTextField(20);
              tf4=new JTextField(20);
              ta=new JTextArea(10,20);
              jb1=new JButton("Insert");
              jb2=new JButton("Clear All");
              jb1.addActionListener(this);
              jb2.addActionListener(this);
              cp.add(tf1);
              cp.add(tf2);
              cp.add(tf3);
              cp.add(tf4);
              cp.add(jb1);
              cp.add(jb2);
              cp.add(ta);
         }
         public void actionPerformed(ActionEvent ae)
         {
              if(ae.getSource()==jb1)
              {
                   int a=Integer.parseInt(tf1.getText());
                   String b=tf2.getText();
                   int c=Integer.parseInt(tf3.getText());
                   String d=tf4.getText();
                   try
                   {
                        int e=stmt.executeUpdate("INSERT INTO EMP VALUES("+a+",'"+b+"',"+c+",'"+d+"')");
                        if(e>0)
                        ta.setText("("+e+") rows effected.");
                        else
                        ta.setText("Error!");
                   }
                   catch(Exception e)
                   {
                        ta.setText(e.toString());
                   }
              }
              else
              {
                   ta.setText("");
                   tf1.setText("");
                   tf2.setText("");
                   tf3.setText("");
                   tf4.setText("");
              }
         }
         public static void main(String args[])
         {
              InsertDemo md=new InsertDemo();
              md.setSize(500,500);
              md.setVisible(true);
         }
    }
    I don't know what to do.
    Help, please!

    Published by: EJP on 29/08/2011-18:47: added {noformat}
    {noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Line 26 is probably con.createStatement?

  • A7 and adapters Metabones

    The absence of glass mount E, I would like to use some of my existing with my A7r F-mount lenses.  One card Metabones will work for the whole family of F?  How well does the IS / VS work with a MB in the mix?

    -Irish

    Metabones has support for Canon lenses.  Expect to pay around $500, but you can use any glass Cannon right here.  If you get too metabones to Nikon adapter, you can use virtually any lens on the market!

    -Irish

  • Informatica PowerCenter and installing PowerConnect adapters 8.6.1

    Hello

    I downloaded below two files to the delivery of oracle site.

    "Oracle Business Intelligence Data Warehouse Administration Console 10.1.3.4.1 for Microsoft Windows and Informatica PowerCenter and adapters PowerConnect 8.6.1 for Windows x 86 (64 bit) (part 1 of 2)"
    "Oracle Business Intelligence Data Warehouse Administration Console 10.1.3.4.1 for Microsoft Windows and Informatica PowerCenter and adapters PowerConnect 8.6.1 for Windows x 86 (64 bit) (part 2 of 2)"

    To install informatica on machine microsoft windows server 64-bit with 4 GB of ram.

    I had 2 forms each download of ZIP files. When I extracted the I had suite of files.

    1. dac_win_101341_infa_win_x86_64bit_861.z01-> in part 1
    and 2. dac_win_101341_infa_win_x86_64bit_861.zip-> in part 2

    Now, I don't get how I should start the installation?

    All pointers in this respect and the entire if possible sequence of steps it would be very useful.

    Thank you
    Mahesh

    Follow this link
    http://gerardnico.com/wiki/PowerCenter/installation_861

    If brand pls help

  • My iPhone 6 guard making his power on and off loading when it is connected with the MacBook Air early 2015

    Hi Please help me. My iPhone 6 retains what load noise when connected with my MacBook Air early 2015. It makes me crazy! I tried with several real Apple's USB cables, update to the latest iOS (phone and MacBook), updated the iTunes, clean the orifices, everything! I just got this MacBook on the Apple store. Please help me! Thanks in advance!

    Hi mikaelaridz,

    I understand that you just bought a MacBook Air in an Apple store, and when you plug your iPhone 6 in it, you are to hear a sound indicating that the connection does not work.  If your MacBook Air has a port USB - C, you must use the USB - C for Lightning cable to connect your iPhone.

    Using the USB - C port and adapters on your MacBook (retina, 12 inch, early 2015) and later

    Port USB - C

    USB - C is an industry standard generation that allows to load and transfer of video data - while a simple connector. Your MacBook comes with a USB - C port:

    Through this port, you can:

    • Charge your MacBook.
    • Power output.
    • Transfer data between your MacBook and other devices.
    • Connect the video output such as HDMI, VGA and DisplayPort.
    • Connect to other technologies, such as Ethernet.

    Port USB - C on your MacBook supports data transfer speeds to up to 5 Gbps (USB 3.1 Gen 1).

    USB - C for Lightning cable

    Apple USB-C for Lightning cable allows you to connect any device equipped with a connector of lightning with your MacBook. It provides data transfer and power of lighting fixtures. For example, you can use this cable to connect your MacBook to these devices:

    • iPhone, iPad and iPod touch
    • Magic Mouse 2
    • Magic keyboard
    • The Magic Trackpad 2

    You can also load these devices without using your MacBook by connecting to the C - USB to the lightning cable and plug the cable of the USB - C 29W power adapter.

    USB - C for Lightning cable supports data transfer at up to 5 Gbps (USB 3.1 Gen 1).

    This cable requires no power to operate. However, devices that you plug into it could draw power from your MacBook, you should unplug it when you're not using it.

    If this isn't the issue, then I suggest taking your new MacBook Air and iPhone at the Apple Storewhere you bought it.  A genius can inspect your computer for you, there is no hardware problems and staff can help you set up.  Here's how Contact Apple and make an appointment.

    Take care

  • Tecra A8-> S - VHS-&gt; only black & white TV output and no sound

    I have a laptop Tecra A8 and want to view files DVD or video on TV. Following the construction of connection is currently in use: computer laptop output, S - VHS cable S-VHS (male), female adapter S-VHS or Pushpin to SCART male, female SCART - SCART female, adapter SCART male - male pin, pin x entry-3 TV (audio video and left/right).
    All the settings are in accordance with the manual of data by TOSHIBA. Go into the display properties of the control panel there is now no possibility of change of colouring of television. Full face mask is blocked and pale gray.
    The result is an output on TV than in black & white and without noise.
    Details of the parameters:
    (1) display devices-> multiple views-> clone dual intel->... peripheral translation: TV
    (2) display TV settings-> video standard: PAL_B-> TV, index parameters: color-> not possible to parameters

    Thank you

    Hello Joachim

    Your ad made me really curious, and I did a few tests with my Tecra laptop. A few days ago I bought all together of cables and adapters Audio/video.

    For the test I have connected my Tecra to Sony BRAVA LCD TV. Just to be precise, I used cables and adapters follow:
    -10 m S-Video cable
    S-Video/http://www.nikomp.com.pl/opisy/AY000/AYVCW12N.jpg adapter cinch
    -SCART adapter http://www.lenexpo-electronics.com/e_italy/i/AdattatoreScartSVHS.jpg
    -Adapter audio http://ecommerce.intermediae.it/images/07628G.jpg
    - And of course 10 m cable audio http://www.elderly.com/images/accessories/ACC/CUAD102.jpg

    I tested it using two different options: TV only and extended desktop. I connected all possible combinations and I got the sound and colorful image.

    The important thing is that the image quality is not one that suits and depending on the resolution selected, but its was perfect. Please do not forget to adjust the sound volume on your laptop. If the sound is set on mute or min level you will not hear anything on TV.

    I don't know what TV you have, but I am 100% sure that there is something wrong with the settings of your TV. I can just recommend properly test you and do not forget that the right port on the TV is turned on.

    Good luck!

  • I connected a VGA cable and clicked on the option monitor, he did not come on my t v

    VGA?

    I connected a VGA cable and clicked on the option monitor, he did not come on my t, v and the screen is black when I plug cable in the future. How can I get the possibility to save change?

    Perhaps the following links will propose a few ideas:

    How to connect my computer to a TV
    http://hookpctotv.com/

    How to connect your PC to your TV
    http://en.kioskea.NET/FAQ/Sujet-228-how-to-connect-your-PC-to-your-TV-set

    PC to TV cables and adapters
    http://www.SVIDEO.com/PC2TV.html

    Windows Vista-
    Connect your computer to a TV
    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-your-computer-to-a-TV

    Windows Vista-
    HDTV: Frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/HDTV-frequently-asked-questions

    Windows Vista-
    From PC to TV, part 1
    Digital media stream to any room with Windows Media Center and Xbox 360
    http://Windows.Microsoft.com/en-us/Windows-Vista/from-PC-to-TV-part-1-stream-digital-media-to-any-room-with-Windows-Media-Center-and-an-Xbox-360

  • bottleneck of apparent control "sounds and audio device properties | audio tab | sound

    Lately, this becomes a little more than one gene, to the point where it seems there are already some solution out there : I often want to spend (internet radio or mp3s) music that I send now based Creative Media USB "broadcasting" (home use - audio send anywhere where I could want him in my house)-for a random downloaded video programming.  Video noise must never be sent to the speakers of my monitor-entertainment (although I wouldn't mind if that sound signal should also go through the creative system to other points in the House.)  But it's scary, sometimes I have to play music, to turn on the monitor and sauté with the music of great volume until I can mute or mute the volume.  But it is never necessary for my music be routed to the monitor.

    I drive the monitor via a HDMI cable and adapters changed just after the last of them went wrong, so the new audio software NVIDIA can get complicated this unduly now.  But it seems that the only way for me to join the audio track from any video source given the monitor is to go through the tedious process to navigate to the audio tab and then change the default devices of the Creative device to the NVIDIA device.  If I have already started the video until I realize that I am still set up for music, I have to leave the VCR and the restart before it will route the audio through the HDMI.

    Then of course if I want to stop watching the video source and go back to something with music as a background, I must reverse this procedure as a whole.

    More complicated still is the panic that can ensue when I receive a Skype call - it can be quite EXPLOSION on the monitor speakers.  These levels seem to chronically inadequate because I assume that they share the same slider control as something else (it's still too low volume without be turned up to 11) and are not put to level automatically, or something like that...

    Certainly I'm not the only one annoyed by these audio problems.  What are the solutions are there for these problems?  I would like to be able to choose speakers, based on sources: mp3s and other audio-only stuff would be default to the Creative device, while avi and other video stuff would be only of course exit by default for the NVIDIA card.  Seems kind of obvious... but it does not work like that?

    Hi 808pants,

    You can try to change the settings for the audio mixer Panel to help relieve this problem:

    http://Windows.Microsoft.com/en-us/Windows7/adjust-the-sound-level-on-your-computer

    In addition, most programs can be configured to use a specific audio adapter. In the case of Skype, you can check the following link to set up Skype:

    http://www.Skype.com/help/guides/soundsetup_vista.HTML#4

    Note: using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    Unless the program is designed to specify the audio adapter, the only way that you can choose where will the audio is by setting the audio adapter by default.

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • U2410 and MacBook Pro - monitor is just a mismatch?

    I just bought myself a large new Dell U2410 IPS-monitor for my photo editing. But when I plug it into my MacBook Pro (from early 2011) using HDMI it does not work. Or rather; It works the first time, but when that I start again it failed to connect. I have used 4 different sets of HMDI cables (including HDMI adapters for the screen on a Mac port) and am about to go crazy.

    The Apple local store checked the laptop and it seems to work fine. If that doesn't seem to be the problem.

    All my HDMI cables and adapters from port simply cannot all be defective

    And my Dell Panel works quite simply wonderful - when it is connected.

    From what I can tell, it may have something to do with the monitor power saving Mode. It keeps incoming mode PS after only 2-3 seconds, and maybe he just can't connect with the laptop entering sleep. Is it possible that in the can PD mode off of?

    And on a second note; Dell monitors like mine computers Mac is simply a mismatch to avoid I want to develop my setup with a second screen of 24 "and certainly want to avoid similar frustration.

    Thanks for the responses and thoughts to this

    Michael

    Thus the U2410 does not have a DVI cable connected to it, and you pressed the button of the monitor #3 input Source selection and chose HDMI?

Maybe you are looking for