c# barcode reader library Oracle Database Setup in Font

Creating PDF-417 2d barcode in Font Oracle Database Setup

Oracle Database Setup
Encode PDF-417 2d Barcode In None
Using Barcode generation for Font Control to generate, create PDF417 image in Font applications.
www.OnBarcode.com
Drawing DataMatrix In None
Using Barcode creation for Font Control to generate, create DataMatrix image in Font applications.
www.OnBarcode.com
$ sqlplus octopus/octopus SQL*Plus: Release 9.2.0.1.0 - Production on Wed Feb 26 17:38:26 2003 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL> describe zdepts; Name Null Type ----------------- -------- -----------DEPT NOT NULL VARCHAR2(32) NAME NOT NULL VARCHAR2(32) LOCATION NOT NULL VARCHAR2(64) COSTCENTER CHAR(32)
QR Code ISO/IEC18004 Creator In None
Using Barcode encoder for Font Control to generate, create Denso QR Bar Code image in Font applications.
www.OnBarcode.com
Paint Barcode In None
Using Barcode drawer for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
CHAPTER 4 RESULTSET METADATA
PDF-417 2d Barcode Creation In None
Using Barcode generation for Font Control to generate, create PDF417 image in Font applications.
www.OnBarcode.com
Painting UCC.EAN - 128 In None
Using Barcode creator for Font Control to generate, create UCC - 12 image in Font applications.
www.OnBarcode.com
Client Using an Oracle Table
Paint Barcode In None
Using Barcode maker for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Bookland EAN Creator In None
Using Barcode encoder for Font Control to generate, create Bookland EAN image in Font applications.
www.OnBarcode.com
import java.util.*; import java.io.*; import java.sql.*; import jcb.db.*; import jcb.meta.*; public class TestOracleTableResultSetMetaDataTool { public static Connection getConnection() throws Exception { String driver = "oracle.jdbc.driver.OracleDriver"; String url = "jdbc:oracle:thin:@localhost:1521:maui"; String username = "octopus"; String password = "octopus"; Class.forName(driver); // load Oracle driver return DriverManager.getConnection(url, username, password); } public static void main(String[] args) { Connection conn = null; try { conn = getConnection(); System.out.println("-------- getResultSetMetaData -------------"); System.out.println("conn="+conn); String deptTableName = "zdepts"; String rsMetaData = ResultSetMetaDataTool.getTableMetaData(conn, deptTableName); System.out.println(rsMetaData); System.out.println("------------------------------------"); } catch(Exception e){ e.printStackTrace(); System.exit(1); } finally { DatabaseUtil.close(conn); } } }
PDF-417 2d Barcode Generator In .NET
Using Barcode maker for ASP.NET Control to generate, create PDF 417 image in ASP.NET applications.
www.OnBarcode.com
Make PDF 417 In Java
Using Barcode drawer for Eclipse BIRT Control to generate, create PDF-417 2d barcode image in BIRT reports applications.
www.OnBarcode.com
CHAPTER 4 RESULTSET METADATA
2D Maker In .NET Framework
Using Barcode encoder for .NET Control to generate, create Matrix 2D Barcode image in .NET framework applications.
www.OnBarcode.com
Barcode Decoder In Java
Using Barcode Control SDK for Eclipse BIRT Control to generate, create, read, scan barcode image in BIRT applications.
www.OnBarcode.com
Output Using an Oracle Table
Make Denso QR Bar Code In None
Using Barcode maker for Word Control to generate, create QR Code JIS X 0510 image in Word applications.
www.OnBarcode.com
Denso QR Bar Code Creation In Java
Using Barcode maker for Android Control to generate, create Quick Response Code image in Android applications.
www.OnBarcode.com
-------- getTableMetaData ------------conn=oracle.jdbc.driver.OracleConnection@169ca65 < xml version='1.0'> <resultSetMetaData columnCount="4"> <columnMetaData column="1" columnDisplaySize="32" columnLabel="DEPT" columnName="DEPT" columnType="12" columnTypeName="VARCHAR2" columnClassName="java.lang.String" tableName="" precision="32" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="true" isDefinitelyWritable="false" isNullable="0" isReadOnly="false" isCaseSensitive="true" isSearchable="true" isSigned="true" catalog="" schema="" /> <columnMetaData column="2" columnDisplaySize="32" columnLabel="NAME" columnName="NAME" columnType="12" columnTypeName="VARCHAR2" columnClassName="java.lang.String" tableName="" precision="32" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="true" isDefinitelyWritable="false" isNullable="0" isReadOnly="false" isCaseSensitive="true" isSearchable="true" isSigned="true" catalog="" schema="" /> <columnMetaData column="3" columnDisplaySize="64" columnLabel="LOCATION" columnName="LOCATION" columnType="12" columnTypeName="VARCHAR2" columnClassName="java.lang.String" tableName="" precision="64" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="true" isDefinitelyWritable="false" isNullable="0" isReadOnly="false" isCaseSensitive="true" isSearchable="true" isSigned="true" catalog="" schema="" /> <columnMetaData column="4" columnDisplaySize="32" columnLabel="COSTCENTER" columnName="COSTCENTER" columnType="1" columnTypeName="CHAR" columnClassName="java.lang.String" tableName="" precision="32" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="true" isDefinitelyWritable="false" isNullable="1" isReadOnly="false" isCaseSensitive="true" isSearchable="true" isSigned="true" catalog="" schema="" /> </resultSetMetaData> ------------------------------------
Encoding 1D Barcode In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create Linear image in Visual Studio .NET applications.
www.OnBarcode.com
Code 128B Encoder In None
Using Barcode drawer for Online Control to generate, create USS Code 128 image in Online applications.
www.OnBarcode.com
CHAPTER 4 RESULTSET METADATA
GS1 - 13 Encoder In Objective-C
Using Barcode generator for iPad Control to generate, create EAN / UCC - 13 image in iPad applications.
www.OnBarcode.com
Generating UPC Code In Objective-C
Using Barcode maker for iPad Control to generate, create Universal Product Code version A image in iPad applications.
www.OnBarcode.com
MySQL Database Setup
Painting QR-Code In None
Using Barcode generator for Online Control to generate, create QR Code JIS X 0510 image in Online applications.
www.OnBarcode.com
Generating Matrix Barcode In Java
Using Barcode creator for Java Control to generate, create Matrix Barcode image in Java applications.
www.OnBarcode.com
mysql> describe zperson; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | id | int(11) | YES | | NULL | | | photo | blob | YES | | NULL | | +-------+---------+------+-----+---------+-------+ 2 rows in set (0.03 sec)
Client Using a MySQL Table
import java.util.*; import java.io.*; import java.sql.*; import jcb.db.*; import jcb.meta.*; public class TestMySqlTableResultSetMetaDataTool { public static Connection getConnection() throws Exception { String driver = "org.gjt.mm.mysql.Driver"; String url = "jdbc:mysql://localhost/octopus"; String username = "root"; String password = "root"; Class.forName(driver); // load MySQL driver return DriverManager.getConnection(url, username, password); } public static void main(String[] args) { Connection conn = null; try { conn = getConnection(); System.out.println("-------- getTableMetaData -------------"); System.out.println("conn="+conn); String deptTableName = "zperson"; String rsMetaData = ResultSetMetaDataTool.getTableMetaData(conn, deptTableName); System.out.println(rsMetaData); System.out.println("------------------------------------"); } catch(Exception e){ e.printStackTrace(); System.exit(1); }
CHAPTER 4 RESULTSET METADATA
finally { DatabaseUtil.close(conn); } } }
Output Using a MySQL Table
-------- getTableMetaData ------------conn=com.mysql.jdbc.Connection@1837697 < xml version='1.0'> <resultSetMetaData columnCount="2"> <columnMetaData column="1" columnDisplaySize="11" columnLabel="id" columnName="id" columnType="4" columnTypeName="LONG" columnClassName="java.lang.Integer" tableName="ZPERSON" precision="11" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="false" isDefinitelyWritable="false" isNullable="1" isReadOnly="false" isCaseSensitive="false" isSearchable="true" isSigned="true" catalog="null" schema="" /> <columnMetaData column="2" columnDisplaySize="65535" columnLabel="photo" columnName="photo" columnType="-4" columnTypeName="BLOB" columnClassName="java.lang.Object" tableName="ZPERSON" precision="0" scale="0" isAutoIncrement="false" isCurrency="false" isWritable="false" isDefinitelyWritable="false" isNullable="1" isReadOnly="false" isCaseSensitive="true" isSearchable="true" isSigned="false" catalog="null" schema="" /> </resultSetMetaData> ------------------------------------
4.9. How Do You Retrieve the Column Types from a ResultSet
In GUI database applications, you must determine the type of a ResultSet s columns in order to validate column values before sending them to the database server. So, to retrieve the column data type from a result set object, let s return the result as a java.util.List, where each element of the list is a java.lang.String, which represents a data type.
The Solution: getTypes()
/** * Get the column data type from a result set object. * @param rs a ResultSet object to process * @throws SQLException Failed to get data types from a ResultSet
CHAPTER 4 RESULTSET METADATA
* @return the result as a java.util.List, where each element of the * list is a String object (designates types). */ public static java.util.List getTypes(ResultSet rs) throws SQLException { if (rs == null) { return null; } ResultSetMetaData meta = rs.getMetaData(); if (meta == null) { return null; } java.util.List types = new java.util.ArrayList(); for (int i = 1; i <= meta.getColumnCount(); i++){ String columnType = meta.getColumnTypeName(i); types.add(columnType); } return types; }
Discussion
The solution presented is a general one: this solution can be applied to any ResultSet object. ResultSetMetaData.getColumnCount() returns the total number of columns for a ResultSet object. ResultSetMetaData.getColumnTypeName(i) returns the column data type name for the ith position (positions start from 1).
Copyright © OnBarcode.com . All rights reserved.