Trying to search a Database in Netbeans

I want to run a simple search query on a database using netbeans but cannot figure out how to access an object or a variable in the SQL query.
The first page has a TextField that has the following properties:
private TextField drugName = new TextField();
public TextField getDrugName() {
return drugName;
public void setDrugName(TextField tf) {
this.drugName = tf;
What I would like for it to do is bring up results that correspond to the above TextField. So that it brings up a list of drugs corresponding to what the user typed into the drugName TextField.
Below is what the SQL query looks like. I want "drugName" to be the TextField from the first page though.
SELECT ALL drug_listing.drug_id,
drug_listing.sequence_number,
drug_listing.label_code,
drug_listing.product_code,
drug_listing.strength,
drug_listing.unit,
drug_listing.rx_otc,
drug_listing.name
FROM drug_listing
WHERE drug_listing.name ; LIKE '%.drugName%'

Some of the concepts you need to familiarize yourself with are working with row sets, data providers, and data binding.
Take a look at these tutorials:
[http://www.netbeans.org/kb/60/web/inserts-updates-deletes.html|http://www.netbeans.org/kb/60/web/inserts-updates-deletes.html]
[http://www.netbeans.org/kb/60/web/databoundcomponents.html|http://www.netbeans.org/kb/60/web/databoundcomponents.html]

Similar Messages

  • Problem in Connectivity to Derby Database in Netbeans IDE

    I am using the newest version of Netbeans IDE
    I already set the variable for JAVA_HOME and DERBY_HOME along with the path variables.
    I am trying to connect to Database in Network Mode
    using the following code
    try
    Class.forName("org.apache.derby.jdbc.ClientDriver");
    catch(ClassNotFoundException exception)
    exception.printStackTrace();
    but it is giving the runtime error that "Unable to load Driver"
    Please help me to get through this

    Try adding the following to your class:
    import org.apache.derby.jdbc.ClientDriver;
    If it produces an error, your driver *.jar file is not in the classpath.

  • Search Server Database problem

    Hi,
    I have a problem with a creation of a new search server database. (I use search1 default search server )
    The command that I used is:
    psadmin create-search-db -s search1 -u amadmin -d defaultand the log response is:
    [#|2008-08-29T01:02:24.518+0200|GRAVE|SJS Portal Server|debug.com.sun.portal.search.admin.mbeans|ThreadID=210
    ; ClassName=com.sun.portal.search.admin.mbeans.Database; MethodName=create; |Error: Creating database default failed with 1|#]
    [#|2008-08-29T01:02:24.521+0200|GRAVE|SJS Portal Server|debug.com.sun.portal.search.admin.mbeans|ThreadID=210
    ; ClassName=com.sun.portal.search.admin.mbeans.Database; MethodName=create; |Exception
    com.sun.portal.admin.common.PSMBeanException
            at com.sun.portal.search.admin.mbeans.Database.create(Database.java:400)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414)
            at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
            at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
            at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
            at com.sun.jdmk.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:203)
            at com.sun.jdmk.interceptor.MBeanServerInterceptorWrapper.invoke(MBeanServerInterceptorWrapper.java:512)
            at com.sun.portal.admin.server.PortalServerLoggingInterceptor.invoke(PortalServerLoggingInterceptor.java:446)
            at com.sun.jdmk.interceptor.ForwardingMBeanServerInterceptor.invoke(ForwardingMBeanServerInterceptor.java:357)
            at com.sun.portal.admin.server.PASAccessControlInterceptor.invoke(PASAccessControlInterceptor.java:72)
            at com.sun.cacao.agent.DispatchInterceptor.invoke(DispatchInterceptor.java:736)
            at com.sun.cacao.agent.auth.impl.AccessControlInterceptor.invoke(AccessControlInterceptor.java:618)
            at com.sun.jdmk.JdmkMBeanServerImpl.invoke(JdmkMBeanServerImpl.java:764)
            at com.sun.cacao.common.instrum.impl.InstrumDefaultForwarder.invoke(InstrumDefaultForwarder.java:106)
            at javax.management.remote.generic.ServerIntermediary.handleRequest(ServerIntermediary.java:280)
            at javax.management.remote.generic.ServerIntermediary$PrivilegedRequestJob.run(ServerIntermediary.java:951)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.management.remote.generic.ServerIntermediary$RequestHandler.handleMBSReqMessage(ServerIntermediary.java:727)
            at javax.management.remote.generic.ServerIntermediary$RequestHandler.execute(ServerIntermediary.java:629)
            at com.sun.jmx.remote.generic.ServerSynchroMessageConnectionImpl$RemoteJob.run(ServerSynchroMessageConnectionImpl.java:266)
            at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:208)
            at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)
    |#]I have the same problem using web console administration
    thanks in advance
    best regards

    Hello,
    I am not sure on below thing, however what userid do you use while logging to psconsole.
    i think might resolve the problem by using the same id in command line.
    I have the same problem using web console administrationI think u r trying to say is psconsole not the web console admin. right?
    regards,
    sumant

  • Newbie Trying to restore Oracle database. please help

    Hi All,
    I am a newbie who is trying to restore Oracle database, I currently use RMAN to backup the database, but the database needs to be restored onto a test server, I'm not quite sure of what I need to do or where I need to start here.
    I currently backup the following
    SPfile
    ControlFile
    Datafile
    Archive Log
    If someone can point me in the right direction or maybe a link to a website, I would be very grateful.
    Thanks.

    Hi,
    login to your box using ssh or telnet
    1. rman> connect target /
    3. rman >startup force nomount;
    4. rman >restore spfile from '/u01/restore/restore/2009_02_07/o1_mf_s_678160942_4rstxj3k_.bkp';
    5. rman > shutdown immediate;
    6. rman > startup nomount;
    7. rman > restore controlfile from '/u01/restore/restore/2009_02_07/o1_mf_s_678160942_4rstxj3k_.bkp';
    8. rman > mount database;
    9. rman > restore database;
    10.rman > recover database;
    11. rman > sql 'alter database open resetlogs';
    below is the sample i've done on my test environment
    RMAN> startup mount;
    connected to target database (not started)
    Oracle instance started
    database mounted
    Total System Global Area 167772160 bytes
    Fixed Size 1218316 bytes
    Variable Size 67111156 bytes
    Database Buffers 96468992 bytes
    Redo Buffers 2973696 bytes
    RMAN> backup database;
    Starting backup at 11-FEB-09
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=158 devtype=DISK
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00001 name=/u01/app/oracle/oradata/ORCL1/datafile/o1_mf_system_4qzm5q6g_.dbf
    input datafile fno=00003 name=/u01/app/oracle/oradata/ORCL1/datafile/o1_mf_sysaux_4qzm5qc1_.dbf
    input datafile fno=00005 name=/u01/app/oracle/oradata/ORCL1/datafile/o1_mf_example_4qzmky86_.dbf
    input datafile fno=00002 name=/u01/app/oracle/oradata/ORCL1/datafile/o1_mf_undotbs1_4qzm5sgk_.dbf
    input datafile fno=00004 name=/u01/app/oracle/oradata/ORCL1/datafile/o1_mf_users_4qzm5vqj_.dbf
    channel ORA_DISK_1: starting piece 1 at 11-FEB-09
    channel ORA_DISK_1: finished piece 1 at 11-FEB-09
    piece handle=/backup/ORCL1_1_1_678528722 tag=TAG20090211T081201 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:02:35
    Finished backup at 11-FEB-09
    Starting Control File and SPFILE Autobackup at 11-FEB-09
    piece handle=/backup/c-1061732667-20090211-00 comment=NONE
    Finished Control File and SPFILE Autobackup at 11-FEB-09
    RMAN>
    --- deleted all my file including spfile..
    RMAN> shutdown immediate;
    database dismounted
    Oracle instance shut down
    RMAN> exit
    Recovery Manager complete.
    [oracle]:/home/oracle>
    [LinuxForOracle.bai.com]: orcl1 >rman target /
    Recovery Manager: Release 10.2.0.1.0 - Production on Wed Feb 11 08:17:27 2009
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database (not started)
    RMAN> startup nomount;
    startup failed: ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0.3/dbs/initorcl1.ora'
    starting Oracle instance without parameter file for retrival of spfile
    Oracle instance started
    Total System Global Area 159383552 bytes
    Fixed Size 1218268 bytes
    Variable Size 54528292 bytes
    Database Buffers 100663296 bytes
    Redo Buffers 2973696 bytes
    RMAN> restore spfile from '/backup/c-1061732667-20090211-00';
    Starting restore at 11-FEB-09
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=36 devtype=DISK
    channel ORA_DISK_1: autobackup found: /backup/c-1061732667-20090211-00
    channel ORA_DISK_1: SPFILE restore from autobackup complete
    Finished restore at 11-FEB-09
    RMAN> shutdown immediate;
    Oracle instance shut down
    RMAN> startup nomount;
    connected to target database (not started)
    Oracle instance started
    Total System Global Area 167772160 bytes
    Fixed Size 1218316 bytes
    Variable Size 67111156 bytes
    Database Buffers 96468992 bytes
    Redo Buffers 2973696 bytes
    RMAN> restore controlfile from '/backup/c-1061732667-20090211-00';
    Starting restore at 11-FEB-09
    using channel ORA_DISK_1
    channel ORA_DISK_1: restoring control file
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
    output filename=/u01/app/oracle/oradata/ORCL1/controlfile/o1_mf_4s5n6jvq_.ctl
    output filename=/u01/app/oracle/flash_recovery_area/ORCL1/controlfile/o1_mf_4s5n6n4f_.ctl
    Finished restore at 11-FEB-09
    RMAN> mount database;
    database mounted
    released channel: ORA_DISK_1
    RMAN> restore database;
    Starting restore at 11-FEB-09
    Starting implicit crosscheck backup at 11-FEB-09
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=156 devtype=DISK
    Crosschecked 1 objects
    Finished implicit crosscheck backup at 11-FEB-09
    Starting implicit crosscheck copy at 11-FEB-09
    using channel ORA_DISK_1
    Finished implicit crosscheck copy at 11-FEB-09
    searching for all files in the recovery area
    cataloging files...
    no files cataloged
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00001 to /u01/app/oracle/oradata/ORCL1/datafile/o1_mf_system_4qzm5q6g_.dbf
    restoring datafile 00002 to /u01/app/oracle/oradata/ORCL1/datafile/o1_mf_undotbs1_4qzm5sgk_.dbf
    restoring datafile 00003 to /u01/app/oracle/oradata/ORCL1/datafile/o1_mf_sysaux_4qzm5qc1_.dbf
    restoring datafile 00004 to /u01/app/oracle/oradata/ORCL1/datafile/o1_mf_users_4qzm5vqj_.dbf
    restoring datafile 00005 to /u01/app/oracle/oradata/ORCL1/datafile/o1_mf_example_4qzmky86_.dbf
    channel ORA_DISK_1: reading from backup piece /backup/ORCL1_1_1_678528722
    channel ORA_DISK_1: restored backup piece 1
    piece handle=/backup/ORCL1_1_1_678528722 tag=TAG20090211T081201
    channel ORA_DISK_1: restore complete, elapsed time: 00:02:57
    Finished restore at 11-FEB-09
    RMAN> recover database;
    Starting recover at 11-FEB-09
    using channel ORA_DISK_1
    starting media recovery
    archive log thread 1 sequence 6 is already on disk as file /u01/app/oracle/flash_recovery_area/ORCL1/onlinelog/o1_mf_2_4qzmccv0_.log
    archive log filename=/u01/app/oracle/flash_recovery_area/ORCL1/onlinelog/o1_mf_2_4qzmccv0_.log thread=1 sequence=6
    media recovery complete, elapsed time: 00:00:01
    Finished recover at 11-FEB-09
    RMAN> sql 'alter database open resetlogs';
    sql statement: alter database open resetlogs
    RMAN> exit
    [oracle]:/home/oracle>
    [LinuxForOracle.bai.com]: orcl1 >sqlplus '/ as sysdba'
    SQL> select name from v$database;
    NAME
    ORCL1
    SQL>
    i hope this will help you... enjoy!
    Regards,
    baidba

  • Trying to open old iPhoto library on osx 10.9.5 with iPhoto 9.5.1.  iPhoto says I must upgrade but upgrade eventually hangs.  Tried to rebuild/repair database but it always says you have to upgrade database first and eventually hangs

    Trying to open old iPhoto library on osx 10.9.5 with iPhoto 9.5.1.  iPhoto says I must upgrade but upgrade eventually hangs.  Tried to rebuild/repair database but it always says you have to upgrade database first and eventually hangs

    What version was the old library made with?
    What is the exact message? when it hangs does it crash or do you have to force quit?
    LN

  • Error while trying to export my database using this command

    Hi,
    I am trying to export my database using this command :
    expdp system/manager@db1 full=n schemas=kul4231 dumpfile=kul4231_20091122.dmp logfile=kul4231_20091122.log directory=dump_dir1
    Error:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORA-31626: job does not exist
    ORA-31637: cannot create job SYS_EXPORT_SCHEMA_05 for user SYSTEM
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.KUPV$FT_INT", line 600
    ORA-39080: failed to create queues "KUPC$C_1_20091122101110" and "" for Data Pump job
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.KUPC$QUE_INT", line 1606
    ORA-01008: not all variables bound
    DB version : Release 10.2.0.4.0
    all ideas are welcomed!!!!!!!!!!!! let me know where am i going wrong!!!!!!!
    thanks in advance..!!!!!!!!
    venkat.

    What is your SGA settings? (especially streams_pool_size).
    You can try to bump streams_pool_size to 100M if your current setting is below that.
    Regards
    Tomasz K.

  • I am trying to remove the older version of iTunes but an error message appears saying that it cannot find the path to 'iTunes64.msi", and I tried the search option to find it on my computer but no such luck. Please help me

    I am trying to remove the older version of iTunes but an error message appears saying that it cannot find the path to 'iTunes64.msi", and I tried the search option to find it on my computer but no such luck. Please help me

    Go to Microsoft website to fix install and Unistall problems. Click "Run now" from Fix it to remove all iTunes & related installer files:
    http://support.microsoft.com/mats/Program_Install_and_Uninstall
    Be aware that Windows Installer CleanUp Utility will not remove the actual program from your computer. However, it will remove the installation files so that you can start the installation, upgrade, or uninstall over.

  • Connecting to Pointbase database in netbeans

    hello all,
    has anyone used Pointbase database in Netbean? I am having connecting to Pointbase due to incorrect password. any idea how i can change password?
    thanks.

    Use the default admin login and modify the password directly in the systables.

  • Could someone help me restore my photos?  I was trying to "restore my database" in iPhoto when it shut down - now my thumbnails are distorted, logged under a new name, and when you click on a thumbnail it opens as another photo.  I was following another "

    Could someone help me restore my photos?  I was trying to "restore my database" in iPhoto when it shut down - now my thumbnails are distorted, logged under a new name, and when you click on a thumbnail it opens as another photo.  I was following another "helpful hint" hold down the option and command key and restart iPhoto - select the top three and you should be able to get rid of the dreaded exclamation point.  My MAC ran through the first two options dealing with thumbnails, but crashed during the "restore database"  step and now I have a mess.  Help, please.  Thank you.

    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • Firefox started, instead of auto filling in the site link with items from history that might be appropriate, trying to search the web instead. How do I go back?

    Before last night, when I typed far I'd get as the top of my list fark.com. Now, instead, it tries to search for Farmers Insurance, Farmville, and Farrah Abraham-- how do I turn that off?

    hello, can you try to replicate this behaviour when you launch firefox in safe mode once? if not, maybe an addon is interfering here...
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]

  • Trying to add a database in DBA studio: getting NLNV String format error

    I'm trying to add a database in DBA studio, but I'm getting the following error:
    Failed to parse tnsnames.ora file
    Error: 100 -- NLNV-NLNV String Format Error
    Does anyone know what I need to do? Thanks.

    Anybody see this before? Yes I have several times, but till today I have not found an answer. Someone from Oracle can help us??
    Thanks
    Chenthil

  • Ora-12154 when trying to connect to database from fortran application

    I am trying to connect to database and run an simple select query to a table(without any where clause) using pro*fortran code.
    the connect strng is like
    exec sql connect :uidpwd
    where uidpwd = username/password@SID
    SID and tnsnames connect string are the same.
    The fortran (profortran) code is placed in the database server and there are no errors when make is run.
    Tnsping is working fine, also i am able to conect using sql*plus and run the same query.
    Please help
    Thanks and Regards
    Nitin

    Hi Nitin
    Thanks for the helpful! With your point I'm now Pro! Great thanks.
    By the way have your seen that?
    Files such as LISTENER.ORA, TNSNAMES.ORA, SQLNET.ORA, if configured manually, or copied and edited from earlier releases of Oracle Database may have record attributes that are incompatible with Oracle Database 10g release 2. The software cannot read such files. The required record format is stream_lf and the record attributes are carriage_control and carriage_return.
    This may result in:
    Inability to start the listener
    Services not registered with the listener
    Inability to connect to other databases
    ORA-12154: TNS:could not resolve service name
    Run the following command on each file affected:
    $ DIR/FULL filename
    An output similar to the following may be displayed:
    Record format: Variable length, maximum 255 bytes
    Record attributes: Carriage return carriage control
    If the output includes the preceding entries, then run the following command:
    $ CONVERT/FDL=SYS$INPUT filename filename
    RECORD
    CARRIAGE_CONTROL CARRIAGE_RETURN
    FORMAT STREAM_LF
    ^Z
    Otherwise herewith an interesting metalink note. Doc ID:      Note:437597.1
    Subject:      Ora-12154 When Executing Pro*Fortran Code Compiled With Oracle 10g.
    Hope this will also help you...
    Cheers
    Hubert

  • How to display multiple tables from database using netbeans swing gui

    plz reply asap on how to display multiple tables from database using netbeans swing gui into the same project

    Layered Pane with JTables or you can easily to it with a little scripting and HTML.
    plzzzzzzzzzzzzzzzzz, do not use SMS speak when posting.

  • ORA-03113 when trying to connect to database

    RDBMS Version:: 9.2.0.6
    Operating System and Version:: Win2003 Small Business Server
    Error Number (if applicable):: ORA-03113
    Server Net Version:: 9.2.0.6
    Client Operating System and Version:: Solaris10
    Client Net Version:: 2.1.3
    ORA-03113 when trying to connect to database
    I've currently a 7.1.3 client on SUN Solaris (5.10 Generic_118844-26 i86pc i386 i86pc) where I want to connect to the 9.2.0.6 database on a Win2003 Server hardware.
    When i try to connect via SQL*Plus (Release 3.1.3.4.1), I get ORA-03113. Looking into the listener resp. alertfile on the server, I can see that the connectiorequest is recognized, but immediately answered by an ORA-0600, producing also trc-files.
    listener: 25-MAI-2007 09:37:23 * (CONNECT_DATA=(SID=HTASQL)(CID=(PROGRAM=)(HOST=eklvpa)(USER=sat250))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.17.233.3)(PORT=32790)) * establish * HTASQL * 0
    alert: ORA-00600: internal error code, arguments: [12333], [26], [0], [115], [], [], [], []
    Activating traces on the client-side showed the following errors:
    -<ERROR>- ntus2err: sd=8, op=1, resnt[0]=511, resnt[1]=2, resnt[2]=0
    -<ERROR>- nserror: nsres: id=0, op=65, ns=12541, ns2=12560; nt[0]=511, nt[1]=2, nt[2]=0
    -<ERROR>- nsopen: unable to open transport
    -<ERROR>- nsprecv: transport read error
    -<ERROR>- nserror: nsres: id=0, op=68, ns=12537, ns2=12560; nt[0]=507, nt[1]=0, nt[2]=0
    -<ERROR>- osnqrc: wanted 1 got 0, type 0
    -<ERROR>- osnqper: error from osnqrc
    -<ERROR>- osnqper: nr err code: 0
    -<ERROR>- osnqper: ns main err code: 12537
    -<ERROR>- osnqper: ns (2) err code: 12560
    -<ERROR>- osnqper: nt main err code: 507
    -<ERROR>- osnqper: nt (2) err code: 0
    -<ERROR>- osnqper: nt OS err code: 0
    -<ERROR>- osnqsm: send-break: failed to send OOB break...
    -<ERROR>- osnqper: error from send-marker
    -<ERROR>- osnqper: nr err code: 0
    -<ERROR>- osnqper: ns main err code: 12583
    -<ERROR>- osnqper: ns (2) err code: 0
    -<ERROR>- osnqper: nt main err code: 0
    -<ERROR>- osnqper: nt (2) err code: 0
    -<ERROR>- osnqper: nt OS err code: 0
    -<ERROR>- osnqbr: returning 3113
    Can anybody help me in determining the problem ? Is there a systemtic incompatibility in connecting a 7.1.3 client to a 9.2 (or even higher) database ?

    Thanks for your reply.
    But the funny thing on this compatibility issues is, that this configuration worked before. The only thing we did, was to setup the client-PC on a new hardware with also a new operating system (upgrading from Solaris 5.8 to 5.10). And from that time we encountered this problem.
    Are there any OS-related problems known or better to say: is (was) ORACLE 7.1.3 supported on Solaris 5.10 ? Should we look for any patches which might help us ?

  • Ora 12154 error when trying to add a database to VS Server Explorer

    Hi Everyone,
    I get the Ora 12154 error when trying to add a database to VS Server Explorer.
    How do I get around this problem.
    The database service is running and I can connect to the database with pl/sql.
    I can also tnsping the database and that is also ok.
    Looks like a problem with the odp.net software.
    I am running the 32 bit Oracle 11g on a Windows7 Home Premium 64 bit PC.
    I am new to this stuff so please help me step by step.
    Thanks.
    Emad

    Hi J. B.
    I have a question related to this. After you told me about the //host:1521/database alias I tried it in a VB 2008 program and it worked and returned data. At least I know that it can be used in a VB program without issues. I just now need to be able to add a connection with the Server Explorer.
    Anyway here is the VB coding I used. I'm new to this and still learning:
    Imports Oracle.DataAccess.Client ' Visual Basic ODP.NET Oracle managed provider
    Public Class Form1
    ' String to connect to the database.
    Dim strConnectionString As String = _
    "Data Source=//emad-pc:1521/emadeva;User ID=scott;Password=tiger;" '
    ' Associate the connection string with a connection object.
    Dim objOracleConnection As New OracleConnection(strConnectionString)
    ' SQL query for returning data rows.
    Dim strSqlQuery As String = _
    "Select dname, deptno " & _
    "From dept " & _
    "Where deptno = 10" '
    ' Command object to make this query work.
    Dim objOracleCommand As New OracleCommand(strSqlQuery, objOracleConnection)
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' Identify what type of command is being used.
    objOracleCommand.CommandType = CommandType.Text
    Try
    objOracleConnection.Open()
    ' Set up a Data Reader and load it with data.
    Dim objOracleDataReader As OracleDataReader = _
    objOracleCommand.ExecuteReader()
    objOracleDataReader.Read()
    ' Convert the department number to a string.
    lblDepartmentNumberFromOracle.Text = _
    CStr(objOracleDataReader.Item("deptno"))
    Catch ex As Exception
    MessageBox.Show(ex.Message, "Error")
    End Try
    End Sub
    End Class
    I still want to thank you for the help you are providing.
    Truly,
    Emad

Maybe you are looking for

  • Custom security provider exception

    Good day, colleagues. I want to raise an old topic. I use custom security provider exceptions: -AccountExpiredException -AccountLockedException However, the login() method only captures FailedLoginException try   CallbackHandler pwcall = new weblogic

  • Weblogic 9.2 : Error occured while deploying due to declaration in DD

    Hi, I was deploying .EAR file in one of the instance of weblogic. But the deployment failed due to following reason : •     Errors occured while initializing a new deployment plan •     Error parsing file "META-INF/weblogic-ejb-jar.xml at line : 19 c

  • Error (-50): the download stop

    Hello everybody, I have a problem: I actually try to download a TV series, I have some épisodes but some of them don't dowload because I have a error (-50) thath appears. I retry severals time but the download not restart ... Can you help me please ?

  • Is Zero is the Automatic Value for fast_start_mttr_target in ORacle10g

    Dear Friends , I am working in Oracle 10g . In Oracle 9i the default value of fast_start_mttr_target is 600 . Now my question is : In Oracle10g , is the '0' value is automatic recovery activities for fast_start_mttr_target (i.e., fast_start_mttr_targ

  • Clear Cache of a Page using Tabs

    Hello, my problem is, that i want to clear the cache of a page, when the user accesses this page by clicking a tab. So my Page has six items, which are used to search people in a db. Under the items is a submit button, which submits the values in the