JDBC - personal.utdallas.edu

JDBC - personal.utdallas.edu

Two Ways to Connect to Oracle8 Note : We are going to use Thin Driver JDBC -Thin Driver(Oracle) Use TCP/IP Port to access database UserId, Password, Host name and database SID are required to connect database The driver is written completely in Java, requires NO pre-installation of any software. Support for Oracle-specific datatypes such as ROWIDs and REFCURSORs Supports all Oracle7 database versions and can also access Oracle8 databases JDBC -Thin Example Connection dbConnection=null; hostname : orabox.utdallas.edu String driver="oracle.jdbc.driver.OracleDriver"; SID : last try{ Class.forName(driver); dbConnection = DriverManager.getConnection("jdbc:oracle:thin:@hostname:1521:SID",

userid",passwd"); Statement statement = dbConnection.createStatement(); ResultSet results = statement.executeQuery(query); while(results.next()){ . } } catch(Exception e){..} Big Picture to Save Java Object Java Class Java Beans Oracle8 XML Doc. Class JOX DTD Parser & Middleware JDBC

Original 4 classes need be modified as Java Beans Place Transition Arch (Token) Using JOX Convert Beans to XML Lib Using XML-DBMS (Ronald Bourret*) or XDK(Oracle), JDBC-Thin Lib Jox115.jar Jaxp.jar Xmldbms.jar (XML-DBMS) DTD Parser(Oracle) Xmlparserv2.jar

XML Parser(Oracle) Xmlparserv2.jar * Ronald Bourret is a freelance programmer Beans to XML JOX JOX is a set of Java libraries that make it easy to transfer data between XML documents and Java beans. You must use Java Beans (get/set methods specifically). JOX uses introspection to figure out the property names. XML tag names must match bean property names within reason. JOX compares XML tags to bean properties ignoring capitalization, dashes, underscores, colons and dots. The XML tag will map successfully to firstName, first_name and fIrSTn_aME. Because XML data is in the form of a tree structure, JOX can't handle bean structures that have circular references unless you use a DTD when writing the XML. JOX tries to convert XML data to the type of the bean property. There is no facility for custom conversions. Without a DTD, JOX uses bean property names as XML tag names. JOX - Example Top Level Java Bean public class TestBean implements java.io.Serializable { protected int foo; protected String bar;

protected TestSubbean subbean; //Nested Class public TestBean() { } public int getFoo() { return foo; } public void setFoo(int aFoo) { foo = aFoo; } public String getBar() { return bar; } public void setBar(String aBar) { bar = aBar; } public TestSubbean getSub() { return subbean; } public void setSub(TestSubbean aSub) { subbean = aSub; } } Nested Java Bean public class TestSubbean implements java.io.Serializable { protected String name; protected int age; public TestSubbean() { } public String getName() { return name; } public void setName(String aName) { name = aName; }

public int getAge() { return age; } public void setAge(int anAge) { age = anAge; } JOX Example (Contd) Application to Convert public class TestSer { public static void main(String[] args) { try { TestBean b = new TestBean(); b.setFoo(5); b.setBar("This is the bar value"); TestSubbean sub = new TestSubbean(); sub.setName("Mark"); sub.setAge(35); b.setSub(sub); FileOutputStream fileOut = new FileOutputStream("bean.xml"); JOXBeanOutputStream joxOut = new JOXBeanOutputStream(fileOut); joxOut.writeObject("MarkTest", b); joxOut.close(); } catch (Exception exc) { exc.printStackTrace(); } } } Bean.xml

?xml version="1.0" encoding="ISO-8859-1"?> 5 This is the bar value 35 XML to/from Oracle8 To be researched I am going to use XML-DBMS and DTD Parser(Oracle) Web resources to be researched Please visit and download related Libraries. http://www.utdallas.edu/~hojch/independentStudy.html JDBC/XML Team Schedule JOX Test : Bean to/from XML Joon/Hitendra XML-DBMS/XDK Test : XML to/from Oracle8 Modify 4 classes to Beans

and JOX Test Joon/Terence Place/ JOX Test Joon Transition/ JOX Test Hitendra Arch/ JOX Test Terence (Token)/ JOX Test Place/ XML-DBMS/XDK Test Joon Transition/ XML-DBMS/XDK Test Hitendra

Arch/ XML-DBMS/XDK Test Terence (Token)/ XML-DBMS/XDK Test Joon/Hitendra JOX Test : Bean to Java Object GUI/System Test All Members 6/30 7/30 8/10

Recently Viewed Presentations

  • Market of Choice

    Market of Choice

    Benefits of Listing on NYSE Euronext Aaron Goldstein Head of Russia and CIS Business Development April 2008 Global Choice of Listing Venues & Products NYSE Euronext - Global Exchange Leadership Global Exchange 1st Transatlantic Marketplace Largest exchange by market capitalization...
  • Title of the Presentation - EconEdLink

    Title of the Presentation - EconEdLink

    Grandpa Jack ran toward the beanstalk and raced down as fast as his little legs would carry him. The giant followed and when Grandpa Jack cut down the beanstalk, the giant crashed to the ground and was never heard of...
  • Christianity


    The Bible The Christian holy book is called The Bible. It is made up of 2 sections, The Old Testament and the New Testament. Symbols The main symbol of Christianity is the cross or crucifix, it reminds Christians that Jesus...
  • Studies of Gamma Radiation Induced Effects in Ge-rich

    Studies of Gamma Radiation Induced Effects in Ge-rich

    Chalcogenide glasses . These glasses are based on the chalcogen elements S, Se, and Te and are formed by the addition of other elements such as Ge, As, Sb, Ga, etc.. They are:. generally transparent from the visible up to...
  • Capgemini NA PowerPoint Template

    Capgemini NA PowerPoint Template

    Status quo, problems and thoughts on the management of civil servants Pension System Paris, 25 June 2015 * * * * * * * Uniqueness of "Massive Source" (DMA - Analytic Monthly Declaration) as the only source of data for...
  • Chapter 1.1: Marketing Basics

    Chapter 1.1: Marketing Basics

    A popular three-day outdoor concert event for country or rock music must be held at a location near the customer base and where nearby businesses, such as hotels and restaurants, can accommodate the needs of the fans. Promotion. is essential...
  • Chapter 2 First Java Programs - Twinsburg

    Chapter 2 First Java Programs - Twinsburg

    Integrated development environment (IDE) BlueJ, Eclipse, or JGrasp. Not free, but combines editor, compiler, debugger, and JVM. Edit, Compile, and Execute (continued) Preparing Your Development Environment: ... Chapter 2 First Java Programs
  • bqb Infra TechnoriumPvt. Ltd.

    bqb Infra TechnoriumPvt. Ltd.

    We provide tailor-made engineered solutions, products, spares and services. Founded as an engineering Company in 2005, headquartered in Gurgaon, India, bqb has quickly built a reputation in the cement industry for its innovation, precise engineering and construction work.