Which is the best way to create a connection object

hi,
Eventhough i am not new to java I just wanted to know that which is the best way for creating sql connection object.
Is it using the DriverManager.getConnection(..,..,..) or using a datasource and getting the connection.
Which is more efficient or Is there any other way to create sql connection which is even more better.
thanks in advance.
pradeepbhargav

AFAIK all connections, DataSource ones included are created by calling the DriverManager. A DataSource is a factory for Connection objects (from JavaDocs)
If you're talking about managing connections then it depends on the application. A DataSource is great for apps that can support many clients or are multi-threaded, but may require a JNDI implementation to get to it.
If however you have an single threaded app that hits the database in a serial fashion, then DataSource is probably an overkill.
Dave

Similar Messages

  • Which is the best way for creating video placeholders in AE?

    I should create some video placeholder for AE animation, but I am not sure which is the best approach to do that.
    I found some tutorials on the web where is explained how to create basic placeholders in AE, but I want to do something better.
    Could I create some placeholder even in Photoshop? And after that to import this psd files into AE.
    I saw some intersting placeholders on Videohive but I don't know how to create something similar?
    Any help?
    Regards!

    Any layer may be replaced with new footage by simply selecting the layer you want to replace in the composition, then selecting the new footage in the project panel, then holding down the Alt/Option key and dragging the new footage to the composition.
    If you want to automate the process of replacing footage you'll have to use a script.
    If you want to use a project as a template then simply copy the template file in it's folder and paste it into a folder that contains the same structure as the template. IOW, the folders should look like this:
    Template Project
         >template.aep
         >Footage
    New project
         >copiedtemplate.aep
         >Footage
    Your footage has to have the same filename as the original template project.
    You can also save an AE project as a template (aet) project. That's what they are doing on siges like Video Hive. The template isn't easily overwritten so it maintains the work. Then you simply add your footage using the first technique that I talked about.

  • WHAT IS THE BEST WAY TO CREATE AN XSD FILE (TO BE USED BY SOAP ADAPTER)

    Dear friends
    I have a simple scenario.
    OUTBOUND DATA  -->  SOAP ADAPTER  --> ( XI )  -->  RFC ADAPTER  --> INBOUND DATA
    The XML file that I got from mapping area of IR (Design) is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_NAME_SOURCE xmlns:ns0="http://test3.com">
       <FIRSTNAME>DAVE</FIRSTNAME>
       <LASTNAME>SMITH</LASTNAME>
    </ns0:MT_NAME_SOURCE>
    If you notice, there are only 2 fields.
    I need to create an XSD file and import it as an external object, which I can use for SOAP Adapter.
    Which is the best way to create it.
    Also, I need to know if there is any step by step of sending a message from XML SPY. I have downloaded this software, but am not able to undertand how to use this.
    Hope to hear from any experts on this forum.
    Thanks in advance
    Ram

    Hi Ram,
    See the below blog..
    It shows how to send SOAP message using XML Spy.
    It also shows how to generate wsdl.
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    Regards,
    Sumit

  • What is the best way to create a SSRS 2005 Line Chart Report for a 12 month period?

    I'm looking for advice on how to create a SQL Server 2005 query and line chart report for SSRS 2005.
    I need to display the peak number of patients assigned to a medical practice each month for a 12 month period based on the end-user selecting a
    single month and year.
    I've previously created a report that displays all patients assigned to the practice for any single month but I’m looking for advice on how to
    how to produce a resultset that shows the peak number of patients each month for a 12 month period. I thought about creating a query that returns the peak count for each month (based on my previously created report which displays all patients assigned to the
    practice for any single month) and then use a UNION statement to join all 12 months but I'm sure that isn't the most efficient way to do this. The other challenge with this approach (twelve resultsets combined via a UNION) is that the end-user needs to be
    able to select any month and year for the parameter and the report needs to display the 12 month period based on the month selected (the month selected would be the last month of the 12 month period).
    For the report I’ve previously created that displays all patients assigned to the practice for any single month, the WHERE statement filters the
    resultset on two fields:
    Start Date - The date the patient was assigned to the practice. This field is never null or blank.
    End Date - The date the patient left the practice. This field can be null or blank as active patients assigned to the practice do not have an End Date. When the patient
    leaves the practice, the date the patient left is populated in this field.
    Using these two fields I can return all patients assigned to the practice during Nov 2012 by looking for patients that meet the following criteria:
    start date prior to 11/30/2012 (using the last day of the month selected ensures patients added mid-month would be included)
    AND
    end date is null or blank (indicates the patient is active) OR the end date is between 11/1/2012 -11/30/2012 (returns patients that leave during the month
    selected)
    Regarding the query I need to create for the report that displays the peak count each month for 12 months, I'm looking for advice on
    how to count patients for each month the patient is assigned to the practice if the patient has been assigned for several months (which applies to most patients). Examples are:
    John Doe has a start date of 6/01/2012 and an End Date of 10/07/2012
    Sally Doe has a start date of 8/4/2012 and no End Date (the patient is still active)
    Jimmy Doe has a  start of 7/3/2012 and an End Date of 9/2/2012
    Given these examples how would I include John Doe in the peak monthly count each month for May - October, Sally Doe in the peak monthly count for
    August - December and Jimmy Doe in the peak monthly count for July – Sept if the end-user running the report selected December 2012 as the parameter?
    Given the example above and the fact I'm creating a line chart I think the best way to create this report would be a resultset that looks like
    this:
    Patient Name              
    Months Assigned
    John Doe
    June 2012
    John Doe                     
    July012
    John Doe                     
    Aug 2012
    John Doe                     
    Sept 2012
    John Doe
    Oct 2012
    Sally Doe                     
    Aug 2012
    Sally Doe                     
    Sept 2012
    Sally Doe
    Oct 2012
    Sally Doe                     
    Nov 2012
    Sally Doe
    Dec 2012
    Jimmy Doe                  
    July 2012
    Jimmy Doe
    Aug 2012
    Jimmy Doe
    Sept 2012
    From the resultset above I could create another resultset that would count\group on month and year to return the peak count for each month:
    June 2012 - 1
    July 2012 – 2
    Aug 2012 - 3
    Sept 2012 - 3
    Oct 2012 - 2
    Nov 2012 - 1
    Dec 2012 - 1
    The resultset that displays the peak count for each month would be used to create the line chart (month would be the X axis and the count would
    be the y axis).
    Does this sound like the best approach?
    If so, any advice on how to create the resultset that lists each patient and each month they were assigned to the practice would be greatly appreciated.
    I do not have permissions to create SPs or Functions within the database but I can create temp tables.
    I know how to create the peak monthly count query (derived from the query that lists each patient and month assigned) as well as the line chart.
    Any advice or help is greatly appreciated.

    Thanks for the replies. I reviewed them shortly after they were submitted but I'm also working on other projects at the same time (hence the delayed reply).
    Building a time table and doing a cross join to my original resultset gave me the desired resultset of the months assigned between dates. What I can't figure out now is how to filter months I don't want. 
    Doing a cross  join between my original resultset that had two dates:
    08/27/2010
    10/24/2011
    and a calendar table that has 24 rows (each month for a two year period)
    my new resultset looks like this:
    I need to filter the rows in yellow as the months assigned for stage 3 that started on 8/27/2010 should stop when the patient was assigned to stage 4 on 10/24/2011.
    You'll notice that Jan - Sept 2011 isn't listed for Stage 4 assigned on 10/24/2011 as I included a filter in the WHERE clause that states
    the Months Assigned value must be greater than or equal to the date assigned value.
    Any advice would be appreciated.

  • Dw, css, and a template, what is the best way to create a 20 page website with a different header in each page?

    dw, css, and a template, what is the best way to create a 20
    page website with different header content on each page? i am
    trying to insert a specific image and background color for each
    header on every page. what is the easiest or best way to do this?
    thanks, bryan

    "mediastream13" <[email protected]> wrote in
    message
    news:f47bes$9om$[email protected]..
    > ok, murray, here is the site.
    http://www.helphotline.org
    > in I.E. 6 i can't see the background color behind the
    header images,
    I'm seeing a hot pink background (which is my browser default
    - so that I do
    remember to declare a background color). You need to add:
    body { background-color: white;} to your stylesheet, or into
    the imbedded
    styles on your page.
    In Firefox, the very top black section, #headertop is hidden
    behind the
    header image.
    > background of the date/time isn't stretching the full
    length of the
    > screen, and
    > the margins aren't working in the main content area. how
    can i put a
    > background
    > color behind the header images?
    I can see the header image stretching right across the page..
    so not sure
    what color is missing there.
    > is there anyway to download i.e. six on my computer if i
    already have
    > i.e.7? i
    > just want to be able to preview the site before i upload
    the changes. it
    > seems
    > everything works in i.e. 7.
    Yes, I used this and it works really well.
    http://tredosoft.com/Multiple_IE
    Nadia
    Adobe® Community Expert : Dreamweaver
    CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    ~ Customisation Service Available ~
    http://www.csstemplates.com.au

  • What's the best way to create basic scrolling up end credits

    What's the best way to create basic scrolling up end credits with FCE. I want create normal look after the film that has a gap between the working title and the name (center-aligned, two-column
    scrolls)
    In the FCE Manual there was a good way to to do it with an asterisk (*) between the the words, but problem occurs when I had an umlaut (ÄÖ) in the word. The asterisk becomes visible and as many umlauts in the working title so many letters missing from the beginning of the name. I'm from Finland and we have lots of umlauts. So is there any other way to do this with FCE.

    You can use Title Crawl in Boris to do this. You set it up like a word processor with a right aligned tab, a gap and then a left aligned tab. Double click in the ruler to create a tab stop. Double click it again to change its alignment. You use the tab key to move between the stops. It's kind of hard to explain, but if you play with it, I think you'll get it.
    There is also Boris documentation on the install disc which will explain it more fully.
    Message was edited by: Tom Wolsky

  • Which is the best way for posting a large number of records?

    I have around 12000 register to commit to dababase.
    Which is the best way for doing it?
    What depends on ?
    Nowadays I can't commit such a large number of register..The dabatase seems hanged!!!
    Thanks in advance

    Xavi wrote:
    Nowadays I can't commit such a large number of registerIt should be possible to insert tens of thousands of rows in a few seconds using an insert statement even with a complex query such as the all_objects view, and commit at the end.
    SQL> create table t as select * from all_objects where 0 = 1;
    Table created.
    Elapsed: 00:00:00.03
    SQL> insert into t select * from all_objects;
    32151 rows created.
    Elapsed: 00:00:09.01
    SQL> commit;
    Commit complete.
    Elapsed: 00:00:00.00
    I meant RECORDS instead of REGISTERS.Maybe that is where you are going wrong, records are for putting on turntables.

  • Please introduce the best way to create education in share point

    Hi
    I want to use chm in share point. but i suppose that there are better ways for training because i think chm is suit for software that are windows-based not web based.
    please introduce the best way to create education in share point
    thanks

    Hi
    these are some directions which will help to create a project for your needs
    Record and share grades with students and parents electronically.
    Create online communities for teachers, administrators, and students to collaborate.
    Facilitate sharing of best practices among teachers and administrators.
    Enable students, parents, faculty, and administrators to access your institution's resources anytime from any connected device.
    Post lesson plans, research content, coursework, and more to online document libraries.
    Provide Web-based class registration, lunch ordering, and other services.
    Create dashboards that show up-to-date student performance data to inform instruction and decisions.
    Share information with your district personnel, school board, parents, and community members.
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • Figuring the best way to create a web site

    hi
    i am an inexperienced java developer. i need to create web application where the user logs in. i want to know wish is the best way to go about.
    for eg,: should all my content be in one jsp file(logic, presentation and db logic) or should i servlets or should develop a j2ee application and have a web server send requests to an application server. i just wanna know which is the best way to develop a sophisticated web site that will not require major code rewriting in future and that won't be difficult to maintain. any advice will be warranted.
    also, what is an application server and is there a free one available.
    regards
    bluJava

    Tas (or anyone) can you perhaps help me design my project....I understand the concept of separating presentation from business and db logic but its difficult to implement while actually coding. For example...
    On one of my jsps a user must select departure and destination cities for a trip. these available cities must be extracted from a database.
    heres the code...
    <th width='50%' class='rowDef' align='left' valign=top>
    <select name='boardingCity'>
    <%
    try {
    cityList = st.executeQuery("SELECT CityCode, CityName FROM CityList");
    while (cityList.next()) {
    out.println("<option value='" + cityList.getString(1) + "' />" + cityList.getString(2));
    } catch (Exception e) {
    System.out.println("checkForAvailability.jsp...Error:" + e);
    cityList.close();
    %>
    </select>
    </th>
    <th width='50%' class='rowDef' align='left' valign=top>
    <select name='destinationCity'>
    <%
    try {
    cityList2 = st.executeQuery("SELECT CityCode, CityName FROM CityList");
    while (cityList2.next()) {
    out.println("<option value='" + cityList2.getString(1) + "' />" + cityList2.getString(2));
    } catch (Exception e) {
    System.out.println("checkForAvailability.jsp...Error:" + e);
    cityList.close();
    %>
    </select>
    </th>
    now how do i go about separating the db logic from the presentation. where will it be coded. do u have sample code?
    regards
    ushanta

  • What's the best way to create a panorama from a series of images?

    What's the best way to create a panorama from a series of images?

    This is PhotoMerge result
    This is WLPG
    This is a manual merge
    Before anyone comments on the poor image quality, I know. Its not my photography.
    The beach huts were in an arc which doesn't help.
    You can see that the photomerged image has not 'understood' the image and has bad destortion on the doors of some huts. The blend lines are also visible

  • Which is the best app to create cartoon images on that i can move around to other apps and animate to create cartoons

    which is the best app to create cartoon images on that I can move around to other apps and animate.  I want to create the image only, no background or anything

    Hi Susan,
    Kindly check out Flash pro CC
    For more details: Explore Adobe desktop apps | Adobe Creative Cloud
    Thanks,
    Atul Saini

  • Which is the Best way to upload BP for 3+ million records??

    Hello Gurus,
                       we have 3+million records of data to be uploaded in to CRM coming from Informatica. which is the best way to upload the data in to CRM, which takes less time consumption and easy. Please help me.
    Thanks,
    Naresh.

    do with bapi BAPI_BUPA_FS_CREATE_FROM_DATA2

  • What is the best way to create business documents in CRM

    Hi All,
    What is the best way to create business documents like contract, sales order, debit memo etc in CRM ? Unlike R3 we can't use our good old BDC with recording. Moreover for most of them although there are Business Object but no BAPI to creation so what is the way ? I found in SDN there are two MAGIC Function module CRMXIF_ORDER_SAVE. Do I need to that alawys ?
    Is it nees to via IDoc and cannot be done just by calling from ABAP program ? The input parameter of the FM is a complex deep structure.
    Please help.

    Ashim,
    Try looking at the program:
    CRM_TEST_ORDER_MAINTAIN
    I think that should help you figure out the parameters.
    Good luck,
    Stephen

  • What is the best way to create a database schema from XML

    What is the best way to create a database schema from XML?
    i have  a complex XML file that I want to create a database from and consistently import new XML files of the same schema type. Currently I have started off by mapping the XSD into Excel and using Mysql for Excel to push into MySQL.
    There must be a more .net microsoft solution for this but I cannot locate the topic and tools by searching. What are the best tools and way to manage this?
    Taking my C# further

    Hi Saythj,
    When mentioning "a database schema from XML", do you mean the
    XML Schema Collections? If that is what you mean, when trying to import XML files of the same schema type, you may take the below approach.
    Create an XML Schema Collection basing on your complex XML, you can find
    many generating tools online to do that.
    Create a Table with the above created schema typed XML column as below.
    CREATE TABLE youTable( Col1 int, Col2 xml (yourXMLSchemaCollection))
    Load your XML files and try to insert the xml content into the table above from C# or some other approaches. The XMLs that can't pass the validation fail inserting into that table.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • What is the best way to create CRUD datagrids

    What is the best way to create CRUD datagrids that tell CF
    components to update sql tables. I find that I'm having to vreate
    all these columns with custom properites and its a bit of a chore:
    <mx:DataGridColumn id = "NatWest" dataField="NatWest"
    headerText="NatWest" editable="false"
    wordWrap="true"
    textAlign="right"
    headerStyleName="centered"
    labelFunction="price_labelFuncNatWest"
    sortCompareFunction="price_sortCompareFunc">
    I don't really want to use any wizards as I want control over
    my code.

    Hi Saythj,
    When mentioning "a database schema from XML", do you mean the
    XML Schema Collections? If that is what you mean, when trying to import XML files of the same schema type, you may take the below approach.
    Create an XML Schema Collection basing on your complex XML, you can find
    many generating tools online to do that.
    Create a Table with the above created schema typed XML column as below.
    CREATE TABLE youTable( Col1 int, Col2 xml (yourXMLSchemaCollection))
    Load your XML files and try to insert the xml content into the table above from C# or some other approaches. The XMLs that can't pass the validation fail inserting into that table.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

Maybe you are looking for

  • Migration from SQL Server 7 to oracle 8.1.7 on windows 2000 professional

    Hello All, I am currently working on Database migration from sql server 7 to oracle 8.1.7. My setup is as follows: 1. Both the databases (sql server and oracle are on the same machine ) 2. My sql server database contains 200 tables and 190 stored pro

  • Intercompany settlement with different currency

    Hello SAP Gurus  Please advice me if any body came across the requirements .  A will issue PO IN US$. A will receive the goods; B will pay the vendor in EURO.I am getting error with currency .How to over come this? Thanks Nick

  • Static / Bad Connection for External Bose Speakers?

    Hello Everyone; I recently bought a new 24" iMac and bought a set of Bose Companion speakers to go with it. I've plugged them into the headphones jack using the cable provided by Bose, but my sound quality is really bad. Theres a lot of static in the

  • Podcasts not showing on ipod

    I've just bought an ipod and i am having trouble getting podcats to show up on it. I have been into preferences and made sure that auto update is checked for podcasts and videos bought i can't seem to fing them on the ipod at all. I have checked that

  • Parallel query processing. (Max Processors)

    Hi Guys, We have a System running on SQL 2000, and it configured to use all available processors. (Server properties>Processor) I am about to change it to use 1 processor as per microsoft recommendation, but there another option when you select fixed