Database appication using java...?

Iam a database programmer using Microsoft Visual Basic 6 as Frunt end & Oracle 8 as back end. Iam a new in java programming & here i also want to make Desktop application using Java JDBC . One of my teacher say that java is basically made for internet i.e web development. If you want to make database application then it is still better to use Microsoft Visual Basic6 instrad of java further more java database is not so much strong as compaired to Visual basic 6...
Iam so much confuse that is java is soo much poor that it does not have a stronge database connectivity with Oracle or Access just like vb6. If yes then it is currect that java language is basially develop for programmers who want to development for the web .
Please guide me in this regards ...being a database programmer what do u suggest me that should i still use VB6 due to good database connectivity with Oracle or Access.
                                   Thanks in advance.

VB actually has a data-bound table control, so the JTable example isn't the best choice for showing off Java's flexibility.
I've used VB and I've used Java, and you'll start to suffer using VB when you have to do something that doesn't have a pre-built control for it already. I'm not incredibly impressed with Java on the desktop, but so far I can easily write classes for any functionality I've needed.
After writing a build program for a newspaper's web site and archive in VB against an Oracle database, I never, ever want to use VB again. It was just too much of a struggle to get the API to do what I wanted.
Java's database access if faster and more flexible, and again, it is much easier to customize your functionality in Java than in the cookie-cutter world of VB.
My rambling two cents.

Similar Messages

  • How to extract payload data from SOA database schema using Java

    I am trying to extract the payload data and output as XML text files using Java. Seems that is stored in SOA table XML_DOCUMENT. I am trying the following Java code to get started and it's not working as I would expect. I only get a few actual lines of output and, when I do, I only get the *<?xml version ... ?>* line.
    I appreciate any advice to extract the payload data from the database. Ultimately I will want to include the composite instance ID in the SQL but for now I'm just using the code shown here:
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    DBBinXMLMetadataProvider dbrep = BinXMLMetadataProviderFactory.createDBMetadataProvider();
    dbrep.setConnectionPool(ods);
    dbrep.associateDataConnection(conn);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor(dbrep);
    while (rset.next()) {
         Blob blob = rset.getBlob("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

    I found a method using a slight variation of the code I originally posted. Essentially you remove the DBBinXMLMetadataProvider dbrep portion. I believe, with this included, the XML being extracted is validated against the database (which is referenced as a "metadata provider"). Since the SOA schema doesn't seem to contain the information to validate the XML it returns as blank. If you don't include the dbrep portion then the XML is extracted as desired.
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("soa_db_connection_string");
    ods.setUser("soa_db_user_id");
    ods.setPassword("soa_db_password");
    Connection conn = ods.getConnection();
    String sql = "select document from xml_document where rownum < 10";
    OraclePreparedStatement stmt = (OraclePreparedStatement)conn.prepareStatement(sql);
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
    XMLDOMImplementation domimpl = new XMLDOMImplementation();
    BinXMLProcessor proc = BinXMLProcessorFactory.createProcessor();
    while (rset.next()) {
         BLOB blob = rset.getBLOB("DOCUMENT");
         BinXMLStream inpbin = proc.createBinXMLStream(blob);
         BinXMLDecoder dec = inpbin.getDecoder();
         InfosetReader xmlreader = dec.getReader();
         XMLDocument doc = (XMLDocument)domimpl.createDocument(xmlreader);
         doc.print(System.out);
    }

  • AIR application and database connectivity (using JAVA)

    Hi
    I am creating AIR application and I want to connect with the database using java database connectivity (JDBC).
    Can any body give me the some suggestion on how to how to do that.
    Please give me any reference for creating AIR application for database connectivity with mysql/access.
    Thanks
    Sameer

    lots of serching on the google and found that For AIR applications either you use Webservices(JAVA/PHP/.Net) or you can use SQLLite.
    Not found any method for direct connectivity with the database using JDBC.
    If any one found direct connecivity withe database using JAVA then please reply.
    Thanks

  • The Oracle Database Programming using Java and Web services book is out

    This book http://www.amazon.com/gp/product/1555583296 shows how to build pragmatic applications using the combination of PL/SQL, Java in the database, JDBC, SQLJ, JPublisher, and Web services. It is intented for database developers, DBA, data architects, Java developers and Web services assemblers.
    My blog http://db360.blogspot.com/ and the free/sample chapter http://www.oracle.com/technology/books/pdfs/mensah_ch1.pdf will give you a feel of the content.
    Enjoy, Kuassi

    Hi Kuassi,
    Thanks for letting us know that your book is available. I have been following one of your articles about "Virtualize Your Oracle Database with Web Services". More specifically "The Database as Web Services Consumer". I think that this is an area that has in the past been under estimated as to the potential benefits.
    I am currently trying to develop a solution that consumes several interfaces with a couple of them being published web services, so an ideal solution. I have then spent the last three weeks having to read up about the architecture of Java in the database, Jpublisher and make sense of how it all works together.
    I have got very close to getting one of the web services to work but failed due to using 10gR2 where all the java & libraries has moved to version 1.5. The solution is to load the jdk1.4.2 and configure jpublisher to use this. So far so good except this is not available on some platforms, Windows - 64 bit (not itanium).
    The configuration is proving very challenging but will hopefully reap rewards.
    (Thought I would give you some background to my experience).
    Anyway my question to you is having looked at Jdeveloper it appears to do almost anything except consume services into the database, also with Java now being at version 1.5 outside the database for 10gR2 and supporting 1.4 inside, do you see some alignment of these in future database releases?
    Finally off to buy your book now as no doubt there is a huge amount more to learn.
    Kind Regards
    David O'Donnell

  • Book: Oracle Database Programming using Java and Web services

    This book http://www.amazon.com/gp/product/1555583296 shows how to build pragmatic applications using the combination of PL/SQL, Java in the database, JDBC, SQLJ, JPublisher, and Web services. It is intented for database developers, DBA, data architects, Java developers and Web services assemblers.
    My blog http://db360.blogspot.com/ and the free/sample chapter http://www.oracle.com/technology/books/pdfs/mensah_ch1.pdf will give you a feel of the content.
    Enjoy, Kuassi

    Hi Kuassi,
    Thanks for letting us know that your book is available. I have been following one of your articles about "Virtualize Your Oracle Database with Web Services". More specifically "The Database as Web Services Consumer". I think that this is an area that has in the past been under estimated as to the potential benefits.
    I am currently trying to develop a solution that consumes several interfaces with a couple of them being published web services, so an ideal solution. I have then spent the last three weeks having to read up about the architecture of Java in the database, Jpublisher and make sense of how it all works together.
    I have got very close to getting one of the web services to work but failed due to using 10gR2 where all the java & libraries has moved to version 1.5. The solution is to load the jdk1.4.2 and configure jpublisher to use this. So far so good except this is not available on some platforms, Windows - 64 bit (not itanium).
    The configuration is proving very challenging but will hopefully reap rewards.
    (Thought I would give you some background to my experience).
    Anyway my question to you is having looked at Jdeveloper it appears to do almost anything except consume services into the database, also with Java now being at version 1.5 outside the database for 10gR2 and supporting 1.4 inside, do you see some alignment of these in future database releases?
    Finally off to buy your book now as no doubt there is a huge amount more to learn.
    Kind Regards
    David O'Donnell

  • Help...create database(access) using java

    i had developed an java application that capture packet using Jpcap but i dont know how to keep the packet captured into database(access).i can save the packet captured in text file but not in database(access).i already had the database conectivity but i don't know how to insert the packet caputred in the table in access, is it using sql statement like INSERT INTO? or else?i realy don't know.can someone help me....?

    i can save the packet captured in to text file but not in database(access).I guess that you wish to get a databse file with your data, not a simple insert sql question.
    1. commercial solution: HXTT Access(http://www.hxtt.com/access.html), which supports create database, create table sql, and batch insert data from any JDBC driver.
    2. free solution: jdbc-odbc bridge and dsn-less jdbc url, you need to prepare a blank mdb file with blank table, then copy that blank mdb file into new mdb file, then repeat insert sql for that new mdb file.

  • Want to be a Database Developer using JAVA

    Hi Friends,
    First of all i would like to introduce my programming background shortly.
    I have been working on oracle using their development tools like developer 6i and oracle APEX since last 10 years. I have developed several database applications for different organizations such as Financials, inventory, Sales, Payroll etc.
    Therefore, I am very desperate to learn JAVA and want to develop database application on it whereas i dont have any language experience. May be it is difficult for me.
    Can you please tell me how can i create database application like form designing, inserting data in oracle database, triggers handling, report designing etc.??
    any helpful website?
    where should i start?
    Please help. i will be thankful.
    Regards,
    Kamran

    Hello friend. Excuse my rather withdrawn answers, but you are getting the same answers as so many people before you have gotten. Take them as an eye opener (or I prefer: brain-widener), do not take offense please.
    Kam_oracle_apex wrote:
    Can you please tell me how can i create database application like form designing, Web applications tend to be used for this purpose, much like you were using Apex previously.
    inserting data in oracle databaseYou write code to do it. You can use a low level API like JDBC to execute plain queries, or you can use a higher level ORM framework to work from the perspective of a hierarchical object model in stead of flat tables
    triggers handlingDatabases handle triggers, not applications
    report designing etc.??You use the right tool for the job, of which there are many
    any helpful website?Google
    where should i start?A book about Java! Amazon user reviews are an excellent guide to know which ones are good and might fit you personally.
    Your very, very first step is to make a 100% switch in the way you think though. You are NOT going to be creating "database applications". You are going to be creating applications which utilize databases. The application's business logic is the lead, not the database. If you cannot make that change in the way you think, you are going to fail into adopting software engineering through a development platform such as Java.

  • How to check the database existence using java.

    Hi All,
    I need to know if a database exists or not using DB2 sql statements. Is there any sql to find that.
    Thanks in advance

    try to connect to the database. if it is possible, the database exists - if not - well there may be a number of reasons, but if your database URL is correct, your network is ok and your database engine is running, the database is not existent.

  • How to create a database using Java?

    Hi there..
    I'm a student who is currently studying IT and was asked to do a project based on database but create using Java.. since i'm a beginner..i was wondering whether is it possible to do that?
    and if it is possible.. can you kindly show me a sample of code on how to start the project...
    thank you
    yours sincerely,
    Shafini

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • How to create sql database using java frame or appelet?

    hi ! i am working on database project i want to create a database using java frame or applet where it asks user to select the location for database to be created , after user have specified the path then the programs creates the database, again i want that database to be read and write by another frame or applet but as user select the path how do i make the connectivity. i just have basic knowledge on java. please give me idea how can i process further.
    thanks a lot

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • MySQL DB file using java

    Is there a way of creating a mySQL database file using java, a file similar to MS Access file?

    I recall a software that save files in .mysql format.
    Didn't know how these files were generated, but I am
    sure of the extension.Well that's swell.
    There is no such file used by MySQL. Further MySQL databases are not contained in a file but in fact use several files and are tied directly to tables. For each table you will have two files, one with structure and one with the data. Then for each index you will have another file.
    That's for MyISAM tables anyway (a MySQL variant of ISAM). For other table engine types it varies but multiple files per table is a common thread.
    The file you are talking about most likely contains SQL queries and is a SQL batch program for creating and populating a database.
    Anyway on to trying to actually resolve your issue. Creating ISAM files from scratch is a no-go to create a database. You can of course always connect to the database engine and issue queries like "CREATE DATABASE" or "CREATE TABLE"
    What is the actual problem you are trying to solve here?

  • How to store file content in BLOB field MySql database using java

    Hi!
    i want to store the file content in a BLOB field in MySql database using java.
    Please help me out..........
    thanx in advance...
    bye

    i stored images in db, and retrieved them. like that cant i store pdf file in db, and retrieve it back using oracle db?
    Plz help me out how to put a file in db. i need complete code. thanks in advance.

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • Possible deadlocks with in-memory database using Java

    I've written a completely in-memory database using the Java API on BDB 4.6 and 4.7 for Windows and Linux (x86). The completely in-memory database means the database content and logs are entirely in-memory and the overflow pages will not be written to a disk file.
    The database environment and the database are configured to be transactional. All database access methods are specified to be auto-commit by setting the transaction argument to null. The environment is configured to be multi-threaded (which is the default when using the Java API).
    When run with a single-threaded client, the application works correctly on both Windows and Linux for BDB 4.6 and 4.7.
    When run with a multi-thread client that uses two thread for the database access, I run into a deadlock inside the call to the Database.delete method about half the time.
    I am assuming that in the "auto-commit" mode, a deadlock should not be possible.
    Any reported problems with using Java with in-memory database?
    Thanks.
    Hisur

    Hi Hisur,
    If you are using transactions and multiple threads, you will have to deal with deadlock. In this particular case, it's likely that a delete is causing two btree pages to be merged (called a "reverse split"). Auto-commit makes no difference in this case -- the application must retry the operation.
    Regards,
    Michael Cahill, Oracle.

  • Inserting a record in database using Java

    Hello All,
    i have connected a Java Application to the SAP BO Database using DI API and would like to insert a record in the demo database without using an SQL Query "Insert into table1...." but using the following snippet though i dont know if am using the right classes :
                                    ICompany company = conn.getCompany();
                                     IItems items = SBOCOMUtil.newItems(company);
                        items.setItemCode("124");
                        items.setItemName("VXC");
                        items.setItemsGroupCode(1);
                        items.setItemType(0);
                        items.add();
    What i am trying to do here is insert a new record but i dont know where i should mention the table name for e.g. there is table called OITM in the demo database from BO where i would like to create a new Item.
    Could anyone help me here.
    Regards,
    Amit Hingher

    Hi Amit,
    You don't need to reference the destination tables as there is a class for each data object in the DI API and the data tables associated with the object are hardcoded in the class.
    The Items class is the correct one for adding item master data (ie data in OITM, OITW etc).
    I'm not very familiar with these Java objects but I think the add method should return an integer value (as it does with the COM objects used by .NET). If the return value is zero then the add was successful. If the add failed then you'll get a non-zero value which is the SBO error code.
    Kind Regards,
    Owen

Maybe you are looking for