| Author |
Need help in java array
|
berender mavi
Greenhorn
Joined: Feb 18, 2011
Posts: 29
|
|
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: 4167
|
|
|
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
Greenhorn
Joined: Feb 18, 2011
Posts: 29
|
|
|
can i use that converted string into "MYSQL IN QUERY"
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4167
|
|
|
Why would you want to? Use a PreparedStatement.
|
 |
berender mavi
Greenhorn
Joined: Feb 18, 2011
Posts: 29
|
|
|
but how i will fetch data from table on the basis of contents of java array
|
 |
 |
|
|
subject: Need help in java array
|
|
|