How to make a SQL database connection with a java code in netbeans?

can somebody helpthrough an example

raghu0007 wrote:
can somebody helpthrough an exampleNetbeans is just an IDE.
Anyway the JDBC tutorial may be found here http://java.sun.com/docs/books/tutorial/jdbc/index.html
If you have a specific question please ask it.

Similar Messages

  • How to make JDBC and SAP connectivity with VC 6.0

    can anyone help me.....how to make JDBC system and SAP system visible in the System drop-down list in Data Task Panel of Visual Composer 6......i mean how to make connectivity with JDBC and SAP system......so that i can use any table in the back-end database as well as any BAPI in the R/3 system.........
    Thank you very much.....

    Hi Deep,
    There is a how-to posted on SDN regarding how to connect and configure the BI JDBC Connector.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    This document describes the jdbc driver to use etc.
    Hope this helps,
    Cheers,
    Scott

  • How to set a pooled database connection with oc4j

    I am testing my application with ocj4 to see how it performs. But I have some doubts about connection pooling.My application only contains jsp and servlets. My database is oracle 8.1.7 and I use the following data-source.xml entry:
    <data-source
    class="com.evermind.sql.DriverManagerDataSource"
    name="pooledPC"
    location="pooledPC-location"
    pooled-location="jdbc/pool/poolPC"
    xa-location="jdbc/xa/HypersonicXADS"
    ejb-location="jdbc/ejb/poolPCDS"
    connection-driver="oracle.jdbc.driver.OracleDriver"
    username="user"
    password="pswd"
    url="jdbc:oracle:thin:@localhost:1521:sid"
    inactivity-timeout="30"
    max_connections="40"
    min_connections="10"
    />
    I have some doubts about:
    - which class should I use: I can choose between com.evermind.sql.DriverManagerDataSource, com.evermind.sql.ConnectionDataSource, com.evermind.sql.OrionPooledDataSource, com.evermind.sql.DriverManagerConnectionPoolDataSource, etc.
    - From where I should take the connections: from location, pooled-location , ..
    Could someone clarify me this issues?
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by [email protected]:
    Are there some other documents about oc4j that you could sent?
    I have been looking on orionserver but the documentation is not complet.<HR></BLOCKQUOTE>
    For Orion, your best bet is not the documentation but to search for your topic via the extensive mailing list. It is quite active and discusses such topics as pooled connections...also for other sorts of information, look at www.orionsupport.com and www.jollem.com.

  • Database connection with a Java applet

    I am having trouble figuring out what I am doing wrong.
    I am able to connect to the remote database from inside JDeveloper 9.0.3 and execute some simple SQL statements.
    The problem is when I try to run this applet on a web page to test it I get some exceptions.
    with e.message()
    access denied (java.util.PropertyPermission oracle.jserver.version read)
    java.security.AccessControlException: access denied (java.util.PropertyPermission oracle.jserver.version read)
    I know from within the IDE I assume the security settings are lax or non-exsistant.
    any ideas?
    Thanks,
    Martin

    Java applets can only access their host machine. If your database is located on a different server than the web server then you get these errors. To access a database located on a different machine you can use the so callled Applet - Servlet tunelling. You actually use a servelt as a proxy. The applet calls the servlet and the servlet accesses the database.
    There is a lot of info on these issues in java.sun.com.
    hope this helps!

  • How can i retrieve a computer name with a java code

    hello friends,
    please, can i get help on how i can rtrieve the name of a computer(any at all) using java - a code will be appreciated.
    i also wish to ask if you know how i can use the JFileChooser class, such that when i click on a file to select it and then click on the open button, the file will open / show in a TextArea which i have already created.
    Moreso, how can i use the JFileChooser to save something i've written in a TextArea, as file to a system.
    thanks in advance for your useful advice. quite grateful.

    'result' is a String I think.
    As for your JFileChooser question...
    Create your take the file returned from JFileChooser, open it in a BufferedReader (I'm assuming it's text as you want to display it in a JTextArea) then read the lines out.
    JFileChooser fc = new JFileChooser();
    fc.showOpenDialog(null);
    File file = fc.getSelectedFile();
    if (file != null) {
    try {
    BufferedReader in = new BufferedReader(new FileReader(file));
    String inputLine;
    String total = "";
    while ((inputLine = in.readLine()) != null)
    total+=inputLine;
    in.close();
    textarea.setText(total); // textarea = your JTextArea
    } catch (Exception e) {
    System.err.println("Error: "+e);
    }

  • SQL Server Database Connectivity with Visual Studio 2012 - Help Needed

    Hello,
    I am having Visual Studio 2012 and SQL Developer 4.0 installed on my system with Windows 8 - 64bit
    I want to shift a VS project with an SQL database connectivity to another new Laptop (above mentioned) ...
    I have the project opened in VS without bieng connected to the database.. 
    I have a backup file of the database (which needs to be restored to a new created database on SQL Developer) 
    The problem:
    I am unable to create a server connection in SQL Developer which will allow me to create a new database followed by the recovery from backup file.
    I am getting the following error message when I try to create a connection:
    Status: Faliure - IO error: The network adapter could not establish a connection
    Please help me in setting up a server connection and adding a new sql database

    The error message seemed unfamiliar to me and since I had never heard of SQL Developer before, I went to Google. Google might be pulling my legs, but it appears that SQL Developer is related to Oracle. This forum is devoted to SQL Server, so you are in the
    wrong place.
    Try finding a forum for SQL Developer.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How TO use configurable Database connection with ADF BC

    I have developed a simple JSF/ ADF BC web application that connects to a database and read/display data from the db tables. I have successfully deployed the application to Tomcat 5.5.17. However, now i need to change the database the application is connecting to. My question is How can I change the Database connection without having to change the application modules or rebuild the war file ??? In other words, is there a specific file (xml) where the database connection can be changed?

    If you set up the application with a data source (I am not sure if this is possible using another app server, I use OC4J), then you would just change it there. However if you created a database connection in the JDEV and pointed your data model to that, then you will have to change and rebuild.
    You might be able to edit the xml file that contains the setttings, I am not sure my CM guys dont allow this, all of our changes have to go through our code repository.

  • How to use Forms Default Database Connection in java class

    When a form based application is started, a connection is made with underlying database. This is the Default (Primay) Database Connection.
    The problem is I have some of my business logic implemented in a java class. In this class I have to make a another connection with the same database. What I want to do is to use the original Database Connection in the java class. In this I may avoid the overhead of reconnection.
    Could anyone pls guide me in this way...

    you can't share the forms connection. Sorry :(

  • How to share the same Database Connection when using several Task Flows ?

    Hi All,
    I’m using JDev 11.1.1.3.0.
    I’m developing ADF Fusion Applications (ABC BC, ADF Faces…)
    These applications are deployed on a Weblogic server.
    Each application has only one Application Module.
    All Application Modules have the same connection type defined: JDBC DataSource : jdbc/GCCDS
    It is working fine.
    I’ve also developed Task Flow Applications for small thinks that are reused in multiple main applications.
    Each Task Flow Application has also one Application Module with the same connections type as main applications.
    All these task flows are deployed to JAR file (ADF Library JAR File) and are reused on my main applications. (drag and drop from the Resource Palette to ADF Regions….).
    There are some parameters passed to Task Flows, so that they can filter data depending on which main applications they are called from.
    Everything is working perfectly.
    All my main applications are using more and more task flows. Which is nice for the reusability etc…?
    Only ONE PROBLEM: DATABASE CONNECTIONS.
    Every Task Flows service made a database connection. So one user may have 10 database connections for the same adf page. And when there are 100 users that are working at the same time, it becomes a problem.
    How to share the same database connections for the main applications and all task flows which are used in the main application?
    Best Regards
    Nicolas

    Hi John,
    When I open a ADF Library JAR file of one of my task flow. (gcc_tf_recentSites.jar)
    I can see TF_RecentSitesService.xml and TF_RecentSitesServiceImpl.class in gcc_tf_recentSites.jar\mu\gcc\tf\recentSites\model\service folder
    + bc4j.xcfg in gcc_tf_recentSites.jar\mu\gcc\tf\recentSites\model\service\common folder.
    bc4j.xcfg details are
    +<?xml version = '1.0' encoding = 'UTF-8'?>+
    +<BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">+
    +<AppModuleConfigBag ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService">+
    +<AppModuleConfig DeployPlatform="LOCAL" jbo.project="mu.gcc.tf.recentSites.model.TF_RecentSites_Model" name="TF_RecentSitesServiceLocal" ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService">+
    +<Security AppModuleJndiName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService"/>+
    +<Custom JDBCDataSource="jdbc/GCCDS"/>+
    +</AppModuleConfig>+
    +<AppModuleConfig name="TF_RecentSitesServiceShared" ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService" DeployPlatform="LOCAL" JDBCName="gccdev" jbo.project="mu.gcc.tf.recentSites.model.TF_RecentSites_Model">+
    +<AM-Pooling jbo.ampool.maxpoolsize="1" jbo.ampool.isuseexclusive="false"/>+
    +<Security AppModuleJndiName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService"/>+
    +</AppModuleConfig>+
    +</AppModuleConfigBag>+
    +</BC4JConfig>+
    So, it seems that the Application Module is packaged with the task flow....
    Is it normal ?
    Regards
    Nicolas

  • How to solve Oracle SQL Developer connection problem ?

    Folks,
    Hello. I am using Oracle Database 11gR1. The Database Control Console https://localhost.localdomain:1158/em works correctly. I can create a Database and a table successfully.
    My OS is Linux and connects to internet successfully.
    In order to run SQL statements. we need to use Oracle SQL Developer. I connect Oracle SQL Developer in the following way:
    Connection Name: DB1 (this is my database name as well)
    Username: SYS (this is the user name I used to login to the Console)
    Password: SYS (this the password used to login to the Console)
    Connection Type: Basic
    Host Name: localhost
    Port: 1158
    SID: DB1 (this is created during installing the Database)
    But the error message comes up: "Status: Failure - IO exception Connection Reset."
    Can any folk tell me how to solve Oracle SQL Developer connection problem ?

    user8860348 wrote:
    Folks,
    Hello. I am using Oracle Database 11gR1. The Database Control Console https://localhost.localdomain:1158/em works correctly. I can create a Database and a table successfully.
    My OS is Linux and connects to internet successfully.
    In order to run SQL statements. we need to use Oracle SQL Developer. I connect Oracle SQL Developer in the following way:
    Connection Name: DB1 (this is my database name as well)
    Username: SYS (this is the user name I used to login to the Console)
    Password: SYS (this the password used to login to the Console)
    Connection Type: Basic
    Host Name: localhost
    Port: 1158
    SID: DB1 (this is created during installing the Database)
    But the error message comes up: "Status: Failure - IO exception Connection Reset."
    Can any folk tell me how to solve Oracle SQL Developer connection problem ?username: sys
    password: enter_your_correct_password given at the time of oracle installation
    role: select sysdba if you would connect as sysdba else select normal for users other than sys
    hostname: enter your oracle server hostname or ip address eg:- 192.168.11.12
    to find the hostname open terminal/command prompt in oracle installed machine
    type ---> hostname
    type ---->ping hostname
    you can find the ipaddress of the server
    port number: 1521 (default) ----> i guess , else check the port number in the tnsnames.ora file under your ORACLE_HOME/network/admin folder
    SID: DB1
    try it
    Good Luck

  • How to make an hypertext link workable with adobe reader for IOS ?

    Hello,
    Hypertext links in a PDF file work perfectly well on Mac OS (Yosemite).
    The same document on an IPAD with IOS is not able to open an hypertext link ...
    How could I do to solve this problem ?
    An author who want to publish electronic books with hypertext links on mobile devices

    Hello Steve,
    All my best wishes for the new year.
    To answer your question :
    . I am writing books on my IMAC with Yosemite  (10.10.1) using Word (14.4.7)
    of  OFFICE MAC.
    . I can open Hyperlink connection by clicking on the link
            . I save the document in a .PDF format
    . This document is sent to my IPAD with IOS 8.1.2
    . In this .PDF document I am no more able to open hyperlink connection
    Please see attached an abstract of my book.
    Thanks a lot for your help and advices.
    Michel Poncet
    Tel: +33 4 76 89 50 82
    http://www.amazon.fr/Glariand-Copent/e/B007NXP7FU
    De :  Steve Werner <[email protected]>
    Répondre à : 
    <[email protected]>
    Date :  vendredi 2 janvier 2015 03:34
    À :  Michel Poncet <[email protected]>
    Objet :   How to make an hypertext link workable with
    adobe reader for IOS ?
    How to make an hypertext link workable with adobe reader for IOS ?
    created by Steve Werner <https://forums.adobe.com/people/Steve+Werner>  in
    Adobe Reader for iOS - View the full discussion
    <https://forums.adobe.com/message/7058559#7058559>
    Hyperlinks can be of several types. What are you linking to? Exactly what
    application did you test the hyperlinks with on the Mac? What application
    did you use to create the hyperlinks?
    If the reply above answers your question, please take a moment to mark this
    answer as correct by visiting:
    https://forums.adobe.com/message/7058559#7058559 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/7058559#7058559 To unsubscribe from this
    thread, please visit the message page at
    , click "Following" at the
    top right, & "Stop Following" Start a new discussion in Adobe Reader for iOS
    by email
    <mailto:[email protected]eso
    ftware.com>  or at Adobe Community
    <https://forums.adobe.com/choose-container.jspa?contentType=1&containerType=
    14&container=4631>  For more information about maintaining your forum email
    notifications please go to https://forums.adobe.com/thread/1516624.

  • OK now that there is no option to reveal "database" panel in DW CC, how do I create a database connection and build my phpmysql pages?

    Is there an alternative way other than manually entering PHP code?

    Thanks, It works. Author of the article politely says what many of us have to say to Adobe when they make "improvements" - WTF, Adobe???
          From: Ben Pleysier <[email protected]>
    To: Jon Lane <[email protected]>
    Sent: Saturday, January 31, 2015 1:44 AM
    Subject:  OK now that there is no option to reveal "database" panel in DW CC, how do I create a database connection and build my phpmysql pages?
    OK now that there is no option to reveal "database" panel in DW CC, how do I create a database connection and build my phpmysql pages?
    created by Ben Pleysier in Dreamweaver support forum - View the full discussionWeb development tutorial
    Deprecated Server Behaviors for Dreamweaver Creative Cloud
    WebAssist A better, more secure and future proof way MySQLi Server Behaviors
    Dreamweaver extension
    WebAssist If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7148099#7148099 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/7148099#7148099 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Dreamweaver support forum by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • How to access the sql database in applet?

    How to access the sql database in applet?
    Please help me.

    import java.applet.*;
    import java.awl.*;
    import java.sql.*;
    //other packages
    public class jdb extends Applet
    Connection con;
    Statement stmt;
    String name="drvijay";
    String phoneno="9842088860";
    public void init(){}
    pubilc void stop(){}
    public void destroy(){}
    public void start()
    call();
    public void call()
    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              conn=DriverManager.getConnection("Jdbc:Odbc:emp","sa","");
              stmt=conn.createStatement();
              stmt.executeUpdate("insert into empdetails(name,phoneno) values ('"+name + "',''"+ phoneno +"' )" );
              }catch(SQLException e)
                   System.out.println("error"+e);
                   System.exit(0);
    //<applet code="jdb" height="200" width="200"> </applet>
    u this jdbc statement in any of the method..
    */

  • Unable to make RMI-based JMX connection with post login stored admin creden

    Hello,
    I've installed a stand-alone OC4J on a couple of servers with Red Hat Enterprise Linux Server release 5.1 (Tikanga).
    At one server I am not bale to start the OC4J properly.This server has two network adresses.
    2008-09-08 14:33:12,670 [EMUI_14_32_57_/console/postLogon] WARN app.PostLogonPageHandler testStoredCredentials.490 - unable to make RMI-based JMX connection with post login stored admin credentials
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    What could be the reason of this error? And how can I solve the problem?
    Thanks in advance,
    Regards Leon

    I don't know for sure, but perhaps the password encryption method uses something from the server to generate a key/seed for the encryption?
    Try and manually reset the credentials to see if it helps
    1. Edit the j2ee/home/config/system-jazn-data.xml file.
    2. Find the oc4jadmin user entry and modify the credentials tag to look like the following
                   <user>
                        <name>oc4jadmin</name>
                        <display-name>OC4J Administrator</display-name>
                        <guid>B23216B0102E11DDBF9DE5D93DCAFE54</guid>
                        <description>OC4J Administrator</description>
                        <credentials>!welcome1</credentials>
                   </user>3. Restart the container and see if you can then login using oc4jadmin/welcome1.
    No guarantees, but its worth a shot.
    -steve-

  • How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    Check for Updates.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%208/78d42b19fa42e8d83b5 5a65e1333373f_zpsf58bbe10.jpg

Maybe you are looking for

  • How can i change my credit card information in itunes?

    My credit card has expired and when I tried to enter a new one in my Itunes account it won't allow me! I've also tried to select Paypal and even though it says in Paypal that Ive created the account with Itunes... it doesn't seem to work in Itunes. C

  • Not Allowing Goods Movements for the confirmed quantity in the delivery

    Hi Gurus, I would like know how to make the system not allowing movement for a batch at MB11  when that batch of one material is confirmed in a delivery?  ex: In the delivery: material number: 9009, Batch  0000A and quantity is 10. And there is no mo

  • In cs5 Photoshop  OXC000001d failed

    The recently intalled software programme is not opening. OXC00001d failed to initialise properly.

  • Time out for opening a PDF File

    I would like to create a file that can only be opened for a small amount of time, say 1 day from the time it is first opened. I would like to have a password on the file. I know how to do that.  For example, I have a file that I send out on Feb 18, 2

  • Hidding T_SCREEN_ACCLIST-BUS_AREA problem

    Hello All, We are wanting to hide the BUS_AREA field. We seem to have sucess using BBP_UI_CONTROL_BADI for all screens except for field T_SCREEN_ACCLIST-BUS_AREA field on SAPLBBP_PDH_ACC screen 1000.  The follwing id the code that was placed in BBP_U