Small prob in ignoring string want to skip 2nd value?
Hi all,
here CONSTRAINT Adept_Usr_Login NOT NULL ,
i have three fixed but 2nd is dynamic how to do this here.
if( tokens0.equalsIgnoreCase( "CONSTRAINT" ) && tokens2.equalsIgnoreCase( "NOT" ) &&
tokens3.equalsIgnoreCase( "NULL" ) )
// dataLines.append( " -- " );
dataLines.append( "NOT " ).append("NULL ").append(" , ").append(" -- ");
dataLines.append( dataLine ).append( '\n' );
Can any one give proper suggestion what to de here.
thanks
Vijendra
i don't know whether i will be properly displayable or not.
import java.util.Enumeration;
import java.io.*;
import java.util.StringTokenizer;
import java.sql.*;
public class FileReading{
public static void main(String args[]){
String file="C:/Documents and Settings/vijendras/Desktop/sampleApplicationchngd.sql";
//modified by vijendra for ignoring views and stored procedures on 11 Apr 2006
try {
// open the file for reading
FileReader inputstream = new FileReader (file);
BufferedReader rdr = new BufferedReader( inputstream );
// the StringBuilder which stores the processed lines
StringBuffer dataLines = new StringBuffer();
// read the file line by line
String dataLine;
boolean pending=false;
while((dataLine = rdr.readLine()) != null ) {
// split the input data into words upto first 3 words only
//String[] tokens = dataLine.split( " ", 3 );
String[] tokens = dataLine.trim().split( " ", 3 );
StringTokenizer st = new StringTokenizer(dataLine.trim()," ");
String tokens0 = "";
String tokens1 = "";
if(st.hasMoreTokens()){
tokens0 = st.nextToken();
if(st.hasMoreTokens()){
tokens1 = st.nextToken();
if (!pending) {
// if the line starts with 'create' and a 'view' follows it,
// then add a "--" to the beginning of the line
if((tokens0.equalsIgnoreCase( "create" ) && tokens1.equalsIgnoreCase( "view" ) )||
(tokens0.equalsIgnoreCase( "create" ) && tokens1.equalsIgnoreCase( "procedure" ))
//state #2
// dataLines.append( "-- " );
// dataLines.append( dataLine ).append( '\n' );
pending = true;
// added by vijendra for modifying CONSTRAINT NAME NOT NULL to NOT NULL on 30 June 2006
//System.out.println(tokens[ 0 ].trim()+"::::"+tokens[ 1 ].trim()+"::::"+tokens[ 2 ].trim());
if( tokens[ 0 ].trim().equalsIgnoreCase( "CONSTRAINT") && tokens[ 2 ].trim().equalsIgnoreCase( "NOT NULL," ) ){
dataLines.append( " NOT " ).append(" NULL ").append(" , ").append(" -- ");
dataLines.append( dataLine ).append( '\n' );
System.out.println( "Executed");
else {
//state #1
// you're not in a[nother] view/proc yet}
//dataLines.append( "-- " );
dataLines.append( dataLine ).append( '\n' );
if (pending) { // don't use 'else'
//line contains ';'
if (!dataLine.endsWith(";")) {
//state #4
// do whatever... you're finished
dataLines.append( "-- " );
dataLines.append( dataLine ).append( '\n' );
else {
// state #3
//you're in continuation of view/proc
//but haven't found end yet
dataLines.append( "-- " );
dataLines.append( dataLine ).append( '\n' );
pending = false;
/*Note the 'if' I marked "don't use else" which allows the logic to fall through and catch both
states #2 and #4 (start and end) on the same line.*/
rdr.close(); // close the file
inputstream.close();
// open the file for writing new data to it
FileWriter outputstream=new FileWriter( file );
BufferedWriter writer = new BufferedWriter(outputstream);
// write the new StringBuilder's data back to the file.
writer.write( dataLines.toString(), 0, dataLines.length() );
writer.close(); // close the file
outputstream.close();
} catch( IOException e ) {
System.out.println("Exception"+e);
out put of sql file is now this but it sholud be applied to all.
CREATE TABLE Adept_User(
Id NUMBER(10, 0) NOT NULL,
Login_Name VARCHAR2(30)
NOT NULL , -- CONSTRAINT Adept_Usr_Login NOT NULL,
First_Name VARCHAR2(35)
CONSTRAINT Adept_Usr_First_name NOT NULL,
Last_Name VARCHAR2(35),
User_Password VARCHAR2(10)
CONSTRAINT Adept_Usr_Last_name NOT NULL,
User_Status NUMBER(10, 0)
CONSTRAINT Adept_Usr_Status NOT NULL,
User_Type NUMBER(10, 0)
CONSTRAINT Adept_Usr_Type NOT NULL,
Customer_Contact NUMBER(10, 0),
Employee NUMBER(10, 0),
Organization Number(10,0),
Password_Modified_Date DATE,
Currency_Master_Id NUMBER(10, 0),
CONSTRAINT PK23 PRIMARY KEY (Id)
CREATE TABLE Adept_User_Group(
Id NUMBER(10, 0) NOT NULL,
Adept_Group NUMBER(10, 0)
CONSTRAINT Adept_Usr_Grp NOT NULL,
Adept_User_Name NUMBER(10, 0)
CONSTRAINT Adept_Usr_name NOT NULL,
CONSTRAINT PK157 PRIMARY KEY (Id)
CREATE TABLE Adept_User_Permission(
Id NUMBER(10, 0) NOT NULL,
Adept_Screens NUMBER(10, 0)
CONSTRAINT Adept_Usr_Perm_Scren NOT NULL,
Adept_User_Group NUMBER(10, 0)
CONSTRAINT Adept_Usr_Grp NOT NULL,
Dashboard char(1),
CONSTRAINT PK28 PRIMARY KEY (Id)
sorry for inconvinience for reading this all.
if there is some better way to show all plese tell me.
Vjendra
Similar Messages
-
I want to skip feedOp create in my FFAS
Hi Friends,
I am using FFAS to AD. In my FF I am getting some records which are logically inactive. I want to skip creation of these users in AD. But by default IDM AS when check AD does not have this user means this is new records and send feedOp as create.
Is there a way I can skip this?
TIARight. I'd say you have 2-options:
#1 -- set a variable (e.g. a flag) inside the A/S input Form if it's a situation where you want to SKIP the intended operation. In other words, you don't really want to do a Create User.
#2 -- set a process variable (e.g. a control point) inside the A/S input Form in this situation and force the A/S input Form to point the input record to a W/F that does nothing.
In #1 (basically what's described in the first reply), it will work, BUT depending on your situation, you might have to modify your Create User, your Update User and your Delete User workflows. So that's 3x the pain and 3x the "stuff" you have to pollute (and I use that term with all respect...) with extra logic. I've done it this way and it will absolutely work.
In #2, you set viewOption.process to the name of the W/F you want to run instead of the one that will be driven to run based on the value of feedOp. The nice thing here, is you can have a single do-nothing W/F that can be invoked for any of the feedOp values you want to ignore and you also can add an audit log record or some debug statements in this to do some testing to make sure it's working the way you want.
Good Luck! -
Small unique hash for Strings???
I have a list of Strings that can have maximum length 25.
I want to map each String to another unique String that is 25 character long.
One way i try was to use md5 (Java Security API) but the md5 hash(in hex) generated for
each String was around 40 character long! but i only have 25 character length
(yes i can not increase it due to some reason).
Is there any way to map a String on another hash or String that is unique?
regards,
THwell, the md5 hash is 16 bytes. You can encode this as 32 characters using ASCII hex encoding. You can then keep the first 25 bytes and throw the rest away. That is one solution.
A better solution is to base64 encode the md5 hash. The base64 encoding of 16 bytes takes only 22 characters, so this is better.
When using md5, or any other cryptographic hash function, there is very small probability of having two strings hash to the same value at random. Using the methods outlined above, this probability is neglible. However, there are recent cryptanalytic results on md5 and even sha1 that show that, in certain scenarios, it may be much easier to choose a string that hashes to the same value as another string.
Perhaps the best option is to investigate algorithms for constructing what are called perfect hash functions. Just google "perfect hash function". -
I have an apple earpods and I use them for my ipad but when I want to skip a song by tapping the middle button twice it doesn't skip the music so what to do?
The procedure is Settings>Messages>Send & Receive at>You can be reached by iMessages at>Add another email address. The email address has to be a valid working email address, obviously. Apple should verify the email address and you have to go to the inbox of that email account, read the verification email from Apple and follow the inductions in the email in order to complete the verification. Then you go back to the settings, uncheck your email address and check the new email address to be used as the contact email address.
-
Small office (5 users) - Accounting - wanting to secure ingress/egress of docs..I haven't seen this answered for an office of this size.I have the need for a relatively cheap software package or guidelines (I'll still keep the search active) for how to block, or at least alert, of sensitive data from leaving the company.I know that I'll have challenges on:1. Blocking certain attachment types from being sent, via webmail, web site attach, email. I am sure someone's written a how-to but I'm darned if I can find it. Suggestions?
2. Blocking certain programs from running (whitelist/blacklist) - not really wanting to be deep in their pockets every time the application is updated, so not sure if a hash list would be a good idea based on a GPO security policy, or if black/white lists are best?3. Web blocking - I'm thinking I am wanting to...
This topic first appeared in the Spiceworks CommunityHi guys,First, I've done a lot of searching on the weband read a few different threads on Spiceworks regarding HIPPA compliance and encrypting hard drives.Specifically these two threads:http://community.spiceworks.com/topic/596465-encryption-for-hipaa-compliancehttp://community.spiceworks.com/topic/320759-how-are-you-handling-hipaa-s-latest-data-at-rest-rulesSo I have a new client that's in the medical field. He has a server that's about two-three years old that looks as ifit was built with budget at the forefront. It's a whitebox with an Asus P8H77-v motherboard, 16 GB of ram, an i3 processor& two 1 TBSATA drives using raid 1 right off the motherboard. The roles it has: DNS/DHCP/File server/AD. Side note - eventhough it's been setup for AD none of the computers are on the domain.Their EMR software is Tracknet & the datais being stored...
-
I want to skip some html code part when refersh the page, how can we know
Hi,
i want to skip some html code part when refersh the page, how can we know when we pressed refresh button or F5 key
thanks in advance....There's not really any simple way to do this. Maybe tracking the page the user should be one from every page in the site and if the page being accessed is the same as the last one accessed, assume it was a refresh.
-
Hi i want to skip a screen in bdc
hi ,
i got issue detors upload .... for some vendors TDS activated but for some it is not activated, so i should skip the screen automatically for those vendor which had not activated TDS.Hi...
suppose you have got from recording the following thing..
PERFORM bdc_field USING 'BDC_OKCODE' '=ok1'.
PERFORM bdc_dynpro USING 'ZPROGRAM' '0500'.
PERFORM bdc_field USING 'BDC_OKCODE' '=ADDRV'.
PERFORM bdc_dynpro USING 'ZPROGRAM' '0600'.
u want to skip the top screen that is 500 based on some conditions...
then put that condition like
PERFORM bdc_field USING 'BDC_OKCODE' '=ok1'.
if <condition>.
PERFORM bdc_dynpro USING 'ZPROGRAM' '0500'.
endif.
PERFORM bdc_field USING 'BDC_OKCODE' '=ADDRV'.
PERFORM bdc_dynpro USING 'ZPROGRAM' '0600'.
then the screen 500 will be skipped.
Reward if useful
Regards
Rudra -
Help needed - want to skip to the menu screen, using any button!
hey there -
i'm creating a DVD in DVD Studio Pro 4 - when the DVD is inserted, the viewer is treated to a bunch of trailers and previews - it's set up with the "First Play" option. i have to do it this way, for the client.
obviously, i'd like the viewer to be able to skip that stuff and go straight to the main menu. after all, that would be a pain to go through, again and again, if one wanted to watch the DVD mulitple times.
i want to create the DVD in such a way where the viewer can hit ANY button to skip the initial previews and end up on the Main Menu screen. they should be able to hit the "chapter forward" button, the "menu" button, or any other button. in other words, this should be a very user friendly DVD, for those that want to skip over this stuff.
is this possible? how do i do it? do i need to make a script? it's bugging the heck out of me, and the deadline is coming up way too fast...
thanks!
-kenneth
mac dual 2.7 G5 Mac OS X (10.4.5) dual-layer burneri want the user to be able to hit the "next chapter" button, or, ideally, any button; to get to the main menu. again, this is during the 2-minute trailer ad that occurs before the menu.
Place a Chapter Marker at the end of the track and set that to have an action to jump to the menu. (Place it at the very end of the track, and also have the tracks end jump jump to the menu, actually to prevent certain players ffrom blowing through chapter markers, place two chapters at the end, the action for the next to last one jumps to the menu, and also DISABLE all actions at the Marker, then the same for the next one.) You can also make it a story witth Marker 1 & 2 and then set the jump to the menu.
The inspector on the track provides all the main buttons on a remote, but some (like subtitle or fast forward) may not do anything or just behavee like they normally behave with no way of overriding them.
If you set the ones you can in the inspector for the track and then also use the chapters described above, you hit most of the main buttons you can.
Since pictures are worth 1000 words, download this little project to see what I am talking about
http://www.geocities.com/mypix013/MenuCall.zip
Also look at this thread
http://discussions.apple.com/thread.jspa?threadID=459698&tstart=0
Where there is some discussion of some things that cannot be done, particularly relating to subtitle buttons (if Hal and Jake say certain things can't happen in DVD SP, you can be pretty much assured that it can't happen) -
I want to send a value from JSP file to another JSP file without..
I want to send a value from one.JSP file to another two.JSP file without to show the content HTML of the one.JSP in two.JSP (with include), only take the values processed in a Bean :
===================
Bean
package pck;
import java.io.*;
public class yyyy {
public String getXxx() {
return cccc;
========================
one.JSP
<jsp:useBean id="idBean" class="pck.yyyy" scope="??"/>
<%idBean.setXxx(ccc);%>
========================
two.JSP
<%@ include file="one.jsp"%>
<%=idBean.getXxx()%>
but without to show the content HTML of one.JSP in two.JSP.
Can someone help me?, please.Why don't just put the common code in a separate file and include it in both. i.e. the code that is in one.jsp that is needed by two.jsp could be put in a common file and included in both pages, thus the HTML is separated off. If this will not work, set a boolean value in two.jsp that can be used by one.jsp to decide if the HTML should be displayed or not.
Steve -
Skip Blank Values in Import-CSV
I am attempting to do a mass import of user attributes (phone number, address, city, state, zip code, title, company). All goes well until I hit a blank value in the CSV. Here is the Powershell script I am trying to use.
Import-Csv IA-Test2.csv |
ForEach-Object {
$record = $_
get-ADUser -LDAPFilter "(samaccountname=$($record.samaccountname))" |
Set-ADUser -city $record.l -postalcode $record.postalcode -OfficePhone $record.OfficePhone -company $record.company -streetaddress $record.streetaddress -title $record.title
How can I modify this to skip blank values?Okay. They're not really blank, but null.
$properties = @(
'city',
'postalcode',
'OfficePhone',
'company',
'streeaddress',
'title'
Import-Csv IA-Test2.csv |
ForEach-Object {
$params = @{}
foreach ($property in $properties)
if ($_.$property)
{ $params.$property = $_.property }
get-ADUser -LDAPFilter "(samaccountname=$($_.samaccountname))" |
Set-ADUser @params
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
I want to add same value/text in every cell in a column in Numbers 3.0
I want to add same value/text in every cell in a column. For example, in all my file names are for pictures that are uploaded to a host site, but the name in the cell does not include the URL associated with it. Does anyone know how to be able to add text to a whole column in front of the current text already in that column?
Assume the filenames are in column C.
Let's says you want to add the text before each file name "http://www.apple.com/"
add a new column (let's say D) and add the formula:
D1="http://www.apple.com/"&C
this is shorthand for... in cell D1 type (or paste from here) the text ""http://www.apple.com/"&C" without the first and last double quotes
select D1, copy
select the column D by clicking the letter D at the top of the column, paste
The "&" is called the concatenate operator and joins two strings together -
I want to assign the value of a Javascript variable to JSP Variable
I want to assign the value of a Javascript variable to JSP Variable .. for example :
<%
Bla Bla Bla
%>
<script>
var JavaScriptVariable="hello"
</script>
<%
String JSPVariable=// The Value of JavaScriptVariable ;
%>
How can i do that ??
Thanks>I want to assign the value of a Javascript variable to JSP Variable
cannot be done.Friend try to understand concepts properly Javascript is always excuted by the browser @clientside where as JSPCode is executed Websever(ServletContainer) @serverside.Through you are combining JSP Code blocks(Tags,Expressions,scriptlets...) & javascript under a single page webserver can only identify what is their under JSP Code blocks.
Hope this could be an appropriate answer for your question.
However,you can as well submit a request by encoding your URL with request parameters and the submit to the page and then collect it using request.getParameter(name).
But under a single context state it is not possible
REGARDS,
RaHuL -
I want to set the value to the radiobutton dynamically.How it possible
Hi all,
I want to set the value to the radio button dynamically.but its giving undefined.
below is the code...
<table>
while(rSet.next())
String sim=rSet.getString(1);
System.out.println("the sim value is:"+sim);
%>
<tr class="forsmalllabel">
<td><input type="radio" name="acsRadio"
value="<%=rSet.getString(1).toString().trim() %>" onClick="validate(this.form)" > </td>
</tr>
<% } %>
</table>
sim variable giving the correct value ...but here ..
whenever I am clicking on the button..it giving undefied message.
my script is below..
<script language="javascript">
function validate(value)
alert("the value is:"+document.ASCCodeform.acsRadio.value);
return true;
</script>
any one help me on this..
urgent.
Thank you,
D.Nagireddy.swish is correct, it can be an array of radio button or a single button. If you have created more than one radio button your will have to use
document.ASCCodeform.acsRadio[x].valuebut if it is only one you will make it:
document.ASCCodeform.acsRadio.value -
Prevent skipping sequence value?
We created a sequenential PK populated from a another database table. We take value from this table and update last sequence value.
( IN ADF faces 11g app)
But if an error in commit processing of page, sequence is populated on the screeen. Error can be formatting error, validation error or etc
Then we correct format mistakes a new number is popolated at PK field.
So some values are skipped.
How can we prevent skipping sequence value? it is very important issue in our bussiness case.
Thanks...We write code in doDML metdod of entity object as following mypackage.getmaxno().
We can posponed getting max no formatting till commit time. Where we need to write code to prevent the gap ?
protected void doDML(int operation, TransactionEvent e) {
if(operation==DML_INSERT){
String sql="{?= call mypackage.getmaxno()}";
CallableStatement cs=getDBTransaction().createCallableStatement(sql,0);
try {
cs.registerOutParameter(1,OracleTypes.VARCHAR);
cs.execute();
String MaxNo=cs.getString(1);
setMaxNo(evrakNo);
createDoc();
} catch (SQLException f) {f.printStackTrace();}
super.doDML(operation, e);
} -
Want to get sequence value from bean
I want to get sequecne value in abean
when i try to make this
String EmpId = (String)JSFUtils.resolveExpression("#{bindings.EmpViewId.inputValue}");Error appear
Caused by: java.lang.ClassCastException: oracle.jbo.domain.DBSequence cannot be cast to java.lang.String
and when i tried
DBSequence EmpId = (DBSequence)JSFUtils.resolveExpression("#{bindings.EmpViewId.inputValue}");another errpr appeared
how can i catch this DBSequence valueyou did not mention your JDev version.
For 10g it might be helpful:
http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_complex006.htm
Example 19-49 Value Change Listener Method for Handling a File Upload Event
String fileUploadLoc =
FacesContext.getCurrentInstance().getExternalContext().
getInitParameter("SRDemo.FILE_UPLOADS_DIR");
if (fileUploadLoc == null) {
// Backup value if context init parameter not set.
fileUploadLoc = "/tmp/srdemo_fileuploads";
//get svrId and append to file upload location
DBSequence svrId =
(DBSequence)ADFUtils.getBoundAttributeValue("SvrId");
fileUploadLoc += "/sr_" + svrId + "_uploadedfiles";
I don't know if it works for 11g too.
NA
http://nickaiva.blogspot.com/
Maybe you are looking for
-
Tried purchasing music from the iTunes Store. When the window popped up I put in my apple id and password. Then I was directed to a 'Terms and Conditions' page. I checked the box next to the 'Yes I agree to these terms and conditions' - then clicked
-
Installing DB 9.2.0 on Red Hat 9
Hi, Can You help me with this? I am trying to install a test Oracle 9.2.0 Data Base on a Red Hat 9 WS. I have followed all recommandations found in these links: http://www.puschitz.com/InstallingOracle9i.shtml http://linux.oreillynet.com/lpt/a/4141 a
-
Specifying current directory in Receiver File Adapter
Hi Experts, I have been configuring a receiver file adapter to place a file onto an FTP server. As per the information provided, as soon as I login to the FTP server, I have to place the file in current logged in directory. In this case, how can I me
-
Some Swedish characters are mis-interpreted by BI publisher.
Hi Team, This is regarding generating reports in PDF format, where user language is other than English. Suppose if language is chosen as Arabic ,In generated reports some characters have been replaced by '?' in PDF. Prior to PDF conversion, xml file
-
Turkish Character Problem using GO function
Hi, We have a requirement of opening new dashboard page as a new page when a link is followed in an analytical request. We are using GO function and we are passing parameters also. Our formula for the column producing the link is like following (I ha