This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Need help in java array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need help in java array" Watch "Need help in java array" New topic
Author

Need help in java array

berender mavi
Ranch Hand

Joined: Feb 18, 2011
Posts: 31
hi all

i want to convert array contents into literals.

suppose i have an array[]={515,234,123}

i want to convert it into '515','234','123'


array length is dynamic contents may be more or less.But i want them to be enclosed in ' ' and separated by ,
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Loop over the array and build a string (using StringBuilder) with the characters you need.


luck, db
There are no new questions, but there may be new answers.
berender mavi
Ranch Hand

Joined: Feb 18, 2011
Posts: 31
can i use that converted string into "MYSQL IN QUERY"
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Why would you want to? Use a PreparedStatement.
berender mavi
Ranch Hand

Joined: Feb 18, 2011
Posts: 31
but how i will fetch data from table on the basis of contents of java array
 
jQuery in Action, 2nd edition
 
subject: Need help in java array
 
Similar Threads
SFTP in Java
How to convert byte array to string array ?
How to convert a number into an Array
Vectors
sending pdf files to IBM MQ