# DsUtils.html Sample

This topic inludes the source code for the DsUtils.html Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/DBScripter/docs/help/doc/en/partners/DBScripter/java-class/dbScript/util/

## Sample Source Code

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
    <!--NewPage-->
    <HTML>
    <HEAD>
    <!-- Generated by javadoc on Fri Oct 10 14:44:38 PDT 2003 -->
    <TITLE>
    DsUtils
    </TITLE>
    <META NAME="keywords" CONTENT="dbScript.util.DsUtils,DsUtils class">
    <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
    </HEAD>
    <SCRIPT>
    function asd()
    {
    parent.document.title="DsUtils";
    }
    </SCRIPT>
    <BODY BGCOLOR="white" onload="asd();">

    <!-- ========== START OF NAVBAR ========== -->
    <A NAME="navbar_top"><!-- --></A>
    <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
    <TR>
    <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    <A NAME="navbar_top_firstrow"><!-- --></A>
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
      <TR ALIGN="center" VALIGN="top">
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
      </TR>
    </TABLE>
    </TD>
    <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    </EM>
    </TD>
    </TR>

    <TR>
    <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    &nbsp;PREV CLASS&nbsp;
    &nbsp;NEXT CLASS</FONT></TD>
    <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
      <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
    &nbsp;<A HREF="DsUtils.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
    &nbsp;
    <SCRIPT>
      <!--
      if(window==top) {
        document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
      }
      //-->
    </SCRIPT>
    <NOSCRIPT>
    <A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
    </NOSCRIPT>
    </FONT></TD>
    </TR>
    <TR>
    <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
      SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
    <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
    </TR>
    </TABLE>
    <!-- =========== END OF NAVBAR =========== -->

    <HR>
    <!-- ======== START OF CLASS DATA ======== -->
    <H2>
    <FONT SIZE="-1">
    dbScript.util</FONT>
    <BR>
    Class DsUtils</H2>
    <PRE>
    java.lang.Object
      |
      +--<B>dbScript.util.DsUtils</B>
    </PRE>
    <HR>
    <DL>
    <DT>public class <B>DsUtils</B><DT>extends java.lang.Object</DL>

    <P>
    <HR>

    <P>
    <!-- ======== NESTED CLASS SUMMARY ======== -->

    <!-- =========== FIELD SUMMARY =========== -->

    <!-- ======== CONSTRUCTOR SUMMARY ======== -->

    <A NAME="constructor_summary"><!-- --></A>
    <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    <TD COLSPAN=2><FONT SIZE="+2">
    <B>Constructor Summary</B></FONT></TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#DsUtils()">DsUtils</A></B>()</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    </TABLE>
    &nbsp;
    <!-- ========== METHOD SUMMARY =========== -->

    <A NAME="method_summary"><!-- --></A>
    <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    <TD COLSPAN=2><FONT SIZE="+2">
    <B>Method Summary</B></FONT></TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#createDataSource(java.lang.String, java.lang.String, java.lang.String[], java.util.Properties, java.lang.String, java.lang.String, java.lang.String, boolean)">createDataSource</A></B>(java.lang.String&nbsp;driverType,
                     java.lang.String&nbsp;baseName,
                     java.lang.String[]&nbsp;urlValues,
                     java.util.Properties&nbsp;p,
                     java.lang.String&nbsp;passwordToEncrypt,
                     java.lang.String&nbsp;wlsAdminUser,
                     java.lang.String&nbsp;wlsAdminPassword,
                     boolean&nbsp;fCreateNonTxDs)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.util.Collection</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDatasourceJNDINames(MBeanHome)">getDatasourceJNDINames</A></B>(MBeanHome&nbsp;home)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String[]</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDriverList()">getDriverList</A></B>()</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDriverProperties(java.lang.String)">getDriverProperties</A></B>(java.lang.String&nbsp;driverType)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDriverURLDefaults(java.lang.String)">getDriverURLDefaults</A></B>(java.lang.String&nbsp;driverType)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String[]</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDriverURLPrompts(java.lang.String)">getDriverURLPrompts</A></B>(java.lang.String&nbsp;driverType)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getDsName(java.lang.String, boolean)">getDsName</A></B>(java.lang.String&nbsp;baseName,
              boolean&nbsp;fNoTx)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.util.Properties</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getPropertiesFromString(java.lang.String)">getPropertiesFromString</A></B>(java.lang.String&nbsp;props)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
    <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
    <TD><CODE><B><A HREF="../../dbScript/util/DsUtils.html#getTypeForDSName(java.lang.String)">getTypeForDSName</A></B>(java.lang.String&nbsp;dsName)</CODE>

    <BR>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
    </TR>
    </TABLE>
    &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
    <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
    <TD><B>Methods inherited from class java.lang.Object</B></TD>
    </TR>
    <TR BGCOLOR="white" CLASS="TableRowColor">
    <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
    </TR>
    </TABLE>
    &nbsp;
    <P>

    <!-- ============ FIELD DETAIL =========== -->

    <!-- ========= CONSTRUCTOR DETAIL ======== -->

    <A NAME="constructor_detail"><!-- --></A>
    <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    <TD COLSPAN=1><FONT SIZE="+2">
    <B>Constructor Detail</B></FONT></TD>
    </TR>
    </TABLE>

    <A NAME="DsUtils()"><!-- --></A><H3>
    DsUtils</H3>
    <PRE>
    public <B>DsUtils</B>()</PRE>
    <DL>
    </DL>

    <!-- ============ METHOD DETAIL ========== -->

    <A NAME="method_detail"><!-- --></A>
    <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
    <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
    <TD COLSPAN=1><FONT SIZE="+2">
    <B>Method Detail</B></FONT></TD>
    </TR>
    </TABLE>

    <A NAME="getDriverList()"><!-- --></A><H3>
    getDriverList</H3>
    <PRE>
    public java.lang.String[] <B>getDriverList</B>()</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getDriverURLPrompts(java.lang.String)"><!-- --></A><H3>
    getDriverURLPrompts</H3>
    <PRE>
    public java.lang.String[] <B>getDriverURLPrompts</B>(java.lang.String&nbsp;driverType)</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getDriverURLDefaults(java.lang.String)"><!-- --></A><H3>
    getDriverURLDefaults</H3>
    <PRE>
    public java.lang.String <B>getDriverURLDefaults</B>(java.lang.String&nbsp;driverType)</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getDriverProperties(java.lang.String)"><!-- --></A><H3>
    getDriverProperties</H3>
    <PRE>
    public java.lang.String <B>getDriverProperties</B>(java.lang.String&nbsp;driverType)</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getPropertiesFromString(java.lang.String)"><!-- --></A><H3>
    getPropertiesFromString</H3>
    <PRE>
    public java.util.Properties <B>getPropertiesFromString</B>(java.lang.String&nbsp;props)</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <HR>

    <A NAME="createDataSource(java.lang.String, java.lang.String, java.lang.String[], java.util.Properties, java.lang.String, java.lang.String, java.lang.String, boolean)"><!-- --></A><H3>
    createDataSource</H3>
    <PRE>
    public java.lang.String <B>createDataSource</B>(java.lang.String&nbsp;driverType,
                                             java.lang.String&nbsp;baseName,
                                             java.lang.String[]&nbsp;urlValues,
                                             java.util.Properties&nbsp;p,
                                             java.lang.String&nbsp;passwordToEncrypt,
                                             java.lang.String&nbsp;wlsAdminUser,
                                             java.lang.String&nbsp;wlsAdminPassword,
                                             boolean&nbsp;fCreateNonTxDs)
                                      throws java.lang.Exception</PRE>
    <DL>
    <DD><DL>

    <DD><CODE>java.lang.Exception</CODE></DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getDatasourceJNDINames(MBeanHome)"><!-- --></A><H3>
    getDatasourceJNDINames</H3>
    <PRE>
    public java.util.Collection <B>getDatasourceJNDINames</B>(MBeanHome&nbsp;home)
                                                throws java.lang.Exception</PRE>
    <DL>
    <DD><DL>

    <DD><CODE>java.lang.Exception</CODE></DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getTypeForDSName(java.lang.String)"><!-- --></A><H3>
    getTypeForDSName</H3>
    <PRE>
    public java.lang.String <B>getTypeForDSName</B>(java.lang.String&nbsp;dsName)
                                      throws java.lang.Exception</PRE>
    <DL>
    <DD><DL>

    <DD><CODE>java.lang.Exception</CODE></DL>
    </DD>
    </DL>
    <HR>

    <A NAME="getDsName(java.lang.String, boolean)"><!-- --></A><H3>
    getDsName</H3>
    <PRE>
    public java.lang.String <B>getDsName</B>(java.lang.String&nbsp;baseName,
                                      boolean&nbsp;fNoTx)</PRE>
    <DL>
    <DD><DL>
    </DL>
    </DD>
    </DL>
    <!-- ========= END OF CLASS DATA ========= -->
    <HR>

    <!-- ========== START OF NAVBAR ========== -->
    <A NAME="navbar_bottom"><!-- --></A>
    <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
    <TR>
    <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
    <A NAME="navbar_bottom_firstrow"><!-- --></A>
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
      <TR ALIGN="center" VALIGN="top">
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
      <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
      </TR>
    </TABLE>
    </TD>
    <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
    </EM>
    </TD>
    </TR>

    <TR>
    <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    &nbsp;PREV CLASS&nbsp;
    &nbsp;NEXT CLASS</FONT></TD>
    <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
      <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
    &nbsp;<A HREF="DsUtils.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
    &nbsp;
    <SCRIPT>
      <!--
      if(window==top) {
        document.writeln('<A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
      }
      //-->
    </SCRIPT>
    <NOSCRIPT>
    <A HREF="../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
    </NOSCRIPT>
    </FONT></TD>
    </TR>
    <TR>
    <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
      SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
    <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
    DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
    </TR>
    </TABLE>
    <!-- =========== END OF NAVBAR =========== -->

    <HR>

    </BODY>
    </HTML>