Azz Romaysa

Ranch Hand
+ Follow
since Dec 08, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Azz Romaysa

Thank you guys,

This is the query that worked for me:

Arulanand: your last query returned always an empty row.

My problem now is how can I update all these tables once. Could somebody help me?

Kind Regards,

[ February 06, 2007: Message edited by: Azz Romaysa ]

This is what I've so far

It always returns an empty table.

What I want is the following result when menu_item_id = 30:

Or this one when menu_item_id = 25:

What is the query that I should have?
P.S. The menu_item cannot have an url_id and a page_id

[ February 01, 2007: Message edited by: Azz Romaysa ]
Please if somebody can help me with a query.
I've the following tables

I want a query to get the the following data if the menu item links to an internal page:
id | title | published | menu_id | page_id |

and the following data if the menu item links to an url:
id | title | published | menu_id | url_id | url


[ January 31, 2007: Message edited by: Azz Romaysa ]
Please if somebody can help me with a query.
I've the following tables

mysql> select * from menu;
| id | title | description | published |
| 39 | Vrienden | Hier zullen blaa van alles | 1 |
| 40 | Gekke Sites | Ik weet het niet man!!! | 1 |
| 41 | Online Stores | Dat is het | 1 |

mysql> select * from menu_item;
| id | title | published | ordering | menu_id |
| 25 | Damatec Web Solutions | 1 | 1 | 41 |
| 28 | Almorni | 0 | 3 | 40 |
| 29 | Wie zijn wij | 1 | 2 | 41 |
| 30 | Google | 1 | 4 | 39 |

mysql> select * from page;
| id | title | content | created_date | modified_date |
| 1 | Mijn Pagina | Test1 | 00-00-0000 00:00:00 | 00-00-0000 00:00:00 |
| 2 | Wie zijn wij | Test2 | 00-00-0000 00:00:00 | 00-00-0000 00:00:00 |
| 3 | Contact | Test3 | 00-00-0000 00:00:00 | 00-00-0000 00:00:00 |

mysql> select * from page_menu_item;
| id | page_id | menu_item_id |
| 1 | 2 | 25 |

mysql> select * from url;
| id | url | menu_item_id |
| 8 | | 28 |
| 9 | | 29 |
| 10 | | 30 |

I want a query to get the the following data if the menu item links to an internal page:
id | title | published | menu_id | page_id |

and the following data if the menu item links to an url:
id | title | published | menu_id | url_id | url


hello javaranch...i am not receiving any response for my questions!!!
What do you mean by:
capture output and errorstream of the process?

give me a an idea about how to restore my database...
I am now testing my webapplication locally, not on the server.
my .sql files resides into ....\resin-3.0.14\webapps\manager\DBBackups directory, I think it does not matter if you put backup files into bin dir or self created dir!!! That is also not good idea, because after testing i have to upload my webapplication to the server and as you know we have not access to the bin diirectory of the server!!

i have adjusted my code to :
String command = "mysql -h"+host+" -u"+user+" -p"+pw+" "+db;
String vars[] = null;
vars = new String[] {"<", baseDir+fileName, ""};"restore db quesy is: "+command);

but still nothing happens no restore!!!

I also tried to read the content op the file and save it into a string and tried exectuting it , but also no good result...
do you have some sample code doing restore ?
Hello Javaranch specialists, i am waiting for your help?? see can I restore .sql file (contains tables) to mysql database using java code into a webapplication?
my try block looks like:
the next sql 2 commands tried:
mysql -hhost -uuse -ppassword database < sqlFlie
musqlimport -hhost -uuser -ppassword database sqlFile
I also find it strange because no error or exception is found or thrown. so it executes it, but nothing happens (no restore is happened)...

my sql file looks like:
-- Host: Database: mysouq3_db
-- ------------------------------------------------------
-- Server version4.1.8-nt

/*!40101 SET NAMES utf8 */;

-- Table structure for table `admin`

CREATE TABLE `admin` (
`username` varchar(100) NOT NULL default '',
`password` varchar(100) NOT NULL default '',
`role` varchar(100) NOT NULL default '',
PRIMARY KEY (`username`)

-- Dumping data for table `admin`

/*!40000 ALTER TABLE `admin` DISABLE KEYS */;
INSERT INTO `admin` VALUES ('admin','admin','admin');
/*!40000 ALTER TABLE `admin` ENABLE KEYS */;

My Java code looks like:

Runtime rt = Runtime.getRuntime();

String host = "";
String user = Config.DB_USERNAME;
String pw = Config.DB_PASSWORD;
String db = Config.DB_NAME;
String restoreDatabase = this.getRestoreDatabase(baseDir+fileName);

String command = "mysqlimport -h"+host+" -u"+user+" -p"+pw+" "+db+ " "+baseDir+fileName;"restore db quesy is: "+command);
rt.exec(command);"end try");
executing mysqldump with Runtime.getRuntime().exec(mysqldump command) works for me from servlet, in that case i read the dump with inputstream object.

Now i want to restore teh backuped .sql file into databse: i tried with Runtime.getRuntime().exec(mysqlimport command) and Runtime.getRuntime().exec(mysql > .sqlFile) both does not work, is there a another way to restore my datbase from a .sql file?
I do that because i want to give webapplication users the ability make database backup en the ability to restore.
i use mvc architecture for my project (no struts), i am thinking about using tiles. But firstly i need some advise about it, also need answer on the next questions:
1.Is is simple to use tiles without using struts, and what has to be done to configure that?
2.What are the advantges of using tiles?
3.what are the consequenses of using tiles for an existing webapplication whitch uses <jsp:include file and <@include page ?

i hope for a good help.

[ December 28, 2005: Message edited by: Bear Bibeault ]
15 years ago
Yes I'm sorry, it shows the page they were on when they clicked the link to the current resource.

Let's say that the user come from google, and has requested a number of pages in my website. Finaly he has dicided to register. How could I then know that he came from Google?

15 years ago

What I want to do, is to know where the user came from. For example a user has found my website via Google or Yahoo.
Is there a method to get the URL of these websites?

I use this method request.get("Referer"); but it returns only the latest page the user has requested.

Thank you,

Abu Romaysa
15 years ago

I would like to submit a form and send a parameter to a servlet. I tried this but it doesn't work:

I call this function in my jsp:
<a href="javascript: submitButton(customerForm, editCustomerInfo)">Edit customer</a>
The editCustomerInfo is my action (a servlet controller that should be get a parameter).

Could someone please show me where is the problem in that function or help me to make a new?

Abu Romaysa
[ October 15, 2005: Message edited by: Azz Romaysa ]
My webapplication is designed as MVC: for each scenario i use a servlet as controller and dispatcher (depending on requests from the user some action happens: for example a forward to a jsp) read requests from View and takes some action.In my case I have a servlet reading inputs and forwards to jsp's en again from jsp's the servlet is called agian...and somewhere in my servlet i need to reed the HTML code and send that to a customer. By destination i mean a jsp.
15 years ago