MySQL - Database location with space
Hello,
I accidentally used a database path with a space in it. I have been able to rename the volume path, but I am still having a problem with MySQL starting up.
The Service Log has the following:
101013 8:49:11 [Warning] Can't create test file /Volumes/SEG RD1/ServiceData/MySQL/seg1.lower-test
101013 8:49:11 [Warning] Can't create test file /Volumes/SEG RD1/ServiceData/MySQL/seg1.lower-test /usr/libexec/mysqld: Can't change dir to '/Volumes/SEG RD1/ServiceData/MySQL/' (Errcode: 2)
101013 8:49:11 [ERROR] Aborting
101013 8:49:11 [Note] /usr/libexec/mysqld: Shutdown complete
The "SEG RD1" volume is now "SEG-RD1". I cannot find the script that is trying to create the file mentioned so that it may also be updated. I have checked the com.apple.MySQLService.plist file and /etc/my.cnf file.
Any help would be greatly appreciated.
For reference, I talked to Apple Care and we did the following:
1) Moved the MySQL folder referenced in Server Admin to the Trash.
2) Trashed the preference file in /Library/Preferences/com.apple.MySQLService.plist
3) Ran Disk Utility and did a repair of permissions on the boot volume.
4) Rebooted server
5) Opened Server Admin and selected MySQL. (ignore error messages [2])
6) In Settings, browsed and created new folder for MySQL data. Save.
MySQL at this point appears to be working in both logs. Server Admin had all the Settings for MySQL grayed out. So, I used the CLI to set password, add network connections as stated in the Web Technologies Administration manual. After performing the steps, The MySQL service in Server Admin was operating normally. Status reflected the correct state, Settings was editable.
Hope this helps anyone else that runs into this problem. It should be noted that all the data was lost, but since this appears in other posts to be an initial setup problem, I had no data to lose.
Similar Messages
-
Is it possible to change the location of mySQL databases on
a selective basis or whole? I would like to have some databases
on a non-boot volume for various reasons. By default, mySQL creates
the databases in
/var/mysql/
I need to save some of large databases on different volume that has
more storage and also mirrored RAID.
I did not see any settings in /etc/my.cnf for this. I am sure this is doable.
Any suggestions?default data location is /usr/local/mysql/data
You can change this in the my.cnf with
datadir=/my/location/that/I/Want -
Cannot establish mysql database connection with j2ee application
Hello All,
I started studying J2EE technology about a month back. I have this simple application involving a couple of servlets and jsps. The code is from a reliable source , so I know that there is nothing wrong with the prog code. Now the code uses a simple database, where I am stuck! I just can't connect to the database Mysql.
I downloaded Mysql database from the mysql site.
I downloaded JDBC driver for mysql from the same site.
Can somebody please tell me which files(from the driver that I downloaded) have to be unzipped to jar files to be set in the class location?
Any help is highly appreciated.
Thanks
Starting WithJ2EEHello All,
I started studying J2EE technology about a month back. I have this simple application involving a couple of servlets and jsps. The code is from a reliable source , so I know that there is nothing wrong with the prog code. Now the code uses a simple database, where I am stuck! I just can't connect to the database Mysql.
I downloaded Mysql database from the mysql site.
I downloaded JDBC driver for mysql from the same site.
Can somebody please tell me which files(from the driver that I downloaded) have to be unzipped to jar files to be set in the class location?
Any help is highly appreciated.
Thanks
Starting WithJ2EE -
How can I use a mySQL database schema with numeric auto increment primary key instead of GUID?
Hello!
I'm using the TestStand "MySQL Insert (NI)" database schema with GUID as primary key. So everything works fine.
But I prever using numeric values as primary key, because the database is in conjunction with another database which uses numeric values as primary key.
Is this possible?
Has anyone an idea how I can modify the "Generic Recordset (NI)" for use with MySQL?
Thanks!
Configuration:
Microsoft Windows XP
TestStand 3.1
MySQL 4.1.12a
MySQL ODBC 3.51 Driver
BrosigAdam -
The TestStand Database Logging feature does not allow you to run a separate SQL command after executing the command for a statement(table), so I do not think that you can use an auto incrementing column for the tables. There is just no way to get it back in a generic way. One option that I tried is something similar to the Oracle schema where you call a store procedure to return a sequence ID for each record that you want to add.
So you would have to create the following sequence table in MySQL:
CREATE TABLE sequence (id INT NOT NULL);
INSERT INTO sequence VALUES (0);
Then create a stored procedure as shown below that will increment the sequence value and return it in a recordset:
CREATE PROCEDURE `getseqid`()
BEGIN
UPDATE sequence SET id=LAST_INSERT_ID(id+1);
SELECT LAST_INSERT_ID();
END
Then update the MySQL tables to use INT primary and foreign key values, so the TestStand MySQL SQL file to create all tables would have text like this:
CREATE TABLE UUT_RESULT
ID INT PRIMARY KEY,
~
CREATE TABLE STEP_RESULT
ID INT PRIMARY KEY,
UUT_RESULT INT NOT NULL,
~
Then update the schema primary and foreign key columns in the TestStand Database Options dialog box to be INT to match the table. For the primary key columns, you will have to set the Primary Key Type to "Get Value from Recordset" and set the Primary Key Command Text to "call getseqid()". This will call the stored procedure to determine the next value to use as the ID value.
Hope this helps...
Scott Richardson
National Instruments -
Mysql database connection with Labwindows/CVI 2009 sql toolkit
Dear experienced users,
I am using the following software/hardware:
Windows 7/ Mysql database 5.6.15 64-bit with MySql ODBC 5.2 Ansi driver installed
Labwindows/CVI 2009 with sql toolkit
The user DSN of ODBC Data source administrator have been confiugred to one of mysql database. The test MYSQL Connector/ODBC is succesful.
The Labwindows/CVI build setting is configure to debug64 after trying debug (32)
The source code is from the example readtab.c with changes to the dsn I am testing
hdbc = DBConnect ("DSN=dvd_collection");
The error message I have is confusing me.
(it is in the attachd png)
I thought it was due to the 64 bit mysql database. That's why I tried the 64 bit build from Labwiondws/CVI. I alsow tried Labview DB tools open connect.vi. It shows me the same error.
Any suggestion is appreciated.
Thanks,
Jimmy
Attachments:
Capture.PNG 24 KBJimmy
I always use connection strings of the form "DSN=datasourcename;UID=database_user_id; PWD=database_user_password".
Where:
datasourcename = The name of the connection defined in the ODBC connection.
database_user_id = One of the user identities created by the database administrator. Obviously the administrator will lock down the permissions appropriate to the task in hand.
database_user_password = The password that identifies database_user_id, again set by the database administrator.
Note that while it is obviously desireable to lock the permissions down as far as possible on the MySQL server, the more you do so, the slower the database will run, because of the way mySQL searches the permissions tables. -
Mysql DataBase connectivity with PI 7.1
Dear Experts,
I need to connect Mysql DB table to access the data using PI 7.1 and pass it to ECC RFC.
I have configured the sender JDBC channel details as below
JDBC Driver : com.mysql.jdbc.Driver
Connection : jdbc:mysql://<Server>:<port>/<database>
But it showing the below error while starting my Sender channel in RWB.
We already install the above driver com.mysql.jdbc.Driver in PI again it shows the same error.
Kindly help to resolve this issue.
Best Regards,
MonikandanHi Monikandan,
Looks like the driver installation was done properly. You need to check if the installation was proper and re-deploy with proper steps.
Refer https://scn.sap.com/thread/400726.
Regards,
Lavanya R -
Use same report with different MySQL database
I am using CR2008 with MySQL 5.1.
I have a report that works with one of the tables (T1) in a MySQL database (DB1). I have another MySQL database (DB2) with the same table name and structure, except that the data has been updated.
I want to use the same report, but just ask CR2008 to now use DB2 and T1.
Try as I may (using Set Data Source Location...), but I'm not getting anything to work.
I looked for a previous thread on this, but was unsuccessful.
Thanks for any help.
DavidThank you for your helpful response. What I am really asking is this -- when there is a CR2008 report based on db1, table1, and you want to use the SAME report with an identical table in a DIFFERENT database (db2, table1), can I easily use the same report? Or, do I have to generate another version of the report?
Thank you again.
David -
Connection to MySQL database, DBCO settings
Hi experts,
I need to connect to a MySQL database located on a different side.
I do have the IP and domain name (e.g. my.test.com), MySQL DB name (SAPtest), Username (SAPuser) and Password (*****).
I did following entries under DBCO:
Name: SQLtest
DBMS: MSS
User Name: SAPuser
DB-Password: *****
Env. Info: MSSQL_DNS=my.test.com
Connection Limit: -
Connection Optimum: -
I hope you see already, that I get the error message SQL Server does not exists or access denied.
I check already all kind of forum and posts, but couldn´t find a good and satisfying documentation for this case.
Yes, MSS is not MySQL, but different user say it is possible with this settings.
I am thankful for any help!Thank you for the answer.
I know the MSS library is not made by name for connecting to a MySQL DB, but Gudmundur and Pedro Gallardo were giving solutions ON connect SAP to a MySQL database. It really sounds like it is compatible. That might be also the answer why SAP is not offering a special library for MySQL - yes that is really a guess.
Maybe jdbc would be the best solution, but I have no idea how to use it within my ABAP program. Actually I have never used any Java code or programs under SAP.
Do you have a sample code, where there is theI call for the JDBC connection out of my ABAP program to connect and disconnect to the MySQL DB? This would be very helpful.
I simply want to open the connection write some data into the MySQL DB and then close the connection.
Thanks!
Edited by: Rene Gegusch on Jun 14, 2011 8:37 AM -
How to connect to a MySQL database in another server
Dear friends,
I am using Oracle SQL Developer 1.5.3 and I need to connect to a MySQL database located in another server.
I am trying to create a new connection, informing connection name, username and password. Supposing that "Hostname" is the IP server address, I click on "Choose database", but I always receive the following error message: "Status : Failure - Cannot connect to MySQL server".
Please tell me what I should do to solve this situation. Thanks in advance.
Best regards,
FranklinYou need to configure your mysql database to accept connection from your PC for the user you used.
For example,
GRANT ALL ON *.* TO 'someuser'@'somehost';
FLUSH PRIVILEGES; -
Strange problem with MySQL database
Hello,
I'm totally puzzled by a strange error occurring with PHP/MySQL on my website... I hope someone has got an idea of what's going on and can let me know.
In short, I have a MySQL database set up on the remote server where the website is hosted. Some pages of my website access this database with PHP.
If the website is viewed with a browser in Windows (Firefox), it works well, the database data appear on the pages.
If the website is viewed with a browser on Mac OS (Firefox, Safari), it doesn't work: the database isn't accessed, I get no error, just everything on the page below my PHP code is missing.
I've attached two screenshots to show this. The website URL is: http://www.cerc.co.uk/CERC/v02/
The pages were this occurs are: the home page (index.php and alternative index2.php), the Abous us/News page and the About us/News/Archives page.
I really don't get where my mistake is. I would like to keep the remote server connexion details outside the root folder, but I guess that if there is no solution to this problem, then I'll have to move it back (I think it might have worked like that).
Thanks in advance for any comment,
Emilie
More details
I'm using DW CS4 on Windows XP emulated via VMware on Mac OS 10.5 (don't ask why, I wasn't given any choice). I've set up a localhost server on XP via XAMP and the news database is also there.
Because I'm currently flipping often between the testing server and the remote server, I quickly got fed up to change all the time the connexion mode to the database (localhost or remote server) and have to resynchronise the files each time. Hence I decided to automate a bit the way the database is connected to.
1. These 4 HTML pages with PHP code have got the below two lines when the PHP code starts:
$pathpfx = "../.."; // see mysqlconnexion.php
include('assets_design/php/mysqlconnexion.php');
2. mysqlconnexion.php (see code below) calls a "connexion" file (in PHP) depending on the value of one parameter ($conxchoice). If $conxchoice = 1, the "connexion" file on the localhost is called. If $conxchoice = 2, the "connexion" file on the remote server is called. I've stored the appropriate version of mysqlconnexion.php on the localhost and the remote server (and I have checked it a million of times, they're in the right place).
<?php
// This code is called by and therefore included in the code of some PHP pages,
// independently of where the pages are located within the website folder.
// - Connexion to local server: I couldn't get the function include_once to work
// with a relative path, hence the use of an absolute path.
// - Connexion to host server: I couldn't get the function include_once to work
// with an absolute path, hence the use of a relative path. This leads to the
// following problem: the path of conxsrv.php needs to be adapted to the
// position of the calling PHP page within the website, in order for
// conxsrv.php to be found on the server (it is located outside the website
// root folder). The variable $pathpfx is used for this purpose.
$conxchoice = 2; // connect to 1 = testing server, 2 = host server
// Connexion to database
if ( $conxchoice == 1 )
{ include_once('C:\xampp\htdocs\CERC\assets_testing_server_only\conxloc.php'); }
if ( $conxchoice == 2 )
{ include_once("$pathpfx/cgi-bin/sqlconx/conxsrv.php"); }
?>
I would guess that a first hint of solution lies in the comment block, but I've really tried everything I could think of to work with relative path/absolute path respectively, unsuccessfully.
3. The "connexion" file looks like:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conx = "aaa";
$database_conx = "bbb";
$username_conx = "ccc";
$password_conx = "ddd";
$conx = mysql_pconnect($hostname_conx, $username_conx, $password_conx) or trigger_error(mysql_error(),E_USER_ERROR);
?>
With aaa, bbb, ccc and ddd the appropriate value depending on the file. The # lines were introduced by DW when these files were created (I've then changed the variable names and moved the files to another place).
ScreenshotsWell, my question has actually not been answered yet but the problem, as strangely as it appeared, has now disappeared. Best but scariest of all, I didn't do anything. Weird.
Hope it never comes back,
Emilie -
Connecting with mysql database
in order to place the component in the JFrame.
we need to take the location (cooridinates values) of the component from the available mysql database.
how to connect the database field values with our java program???
give me some suggestion pls.....public void actionPerformed(ActionEvent e)
//String x=txt1.getText();
//String y=txt2.getText();
String s ="(Select XPosition from data where parameter=ST01)";
String s1 ="(Select YPosition from data where parameter=ST01)";
int i = Integer.parseInt(s);
int j = Integer.parseInt(s1);
String str = e.getActionCommand();
if(str.equals("btn1"))
cr = new Circle();
cr.setSize(30,30);
cr.setLocation(i,j); // here its problem
p2.add(cr);
show();
it shows the Event dispatch error.... -
Entering data into a mySQL database for use with my JDBC program
does any know what i type on telnet to get mySQL to work on windows 2000?
i read check your isp for what to type in for this line, but i use IIS
www24:mywww/devshed# mysql -u devshed -p
and what do i put for
login: devshed
Password: ********
it says check with isp on that one too
i am trying to insert records, and make columns, is there an easier way to do this?
thanks,
Pearl
Beginning MySQL Tutorial
By W.J. Gilmore
April 03, 1999
Part 1: At First Glance
MySQL is most commonly entered through telnet. (A nice Telnet program, Easyterm, can be found at http://www.arachnoid.com) Once the telnet connection to the web server has been accomplished, a second command provides access to the MySQL server. The procedure to make these connection is as follows:
1. Connect to telnet. This involves the insertion of the given ISP username and password.
--------------------------------------------------------------------------------login: devshed
Password: ********
Last login: Wed Aug 12 09:49:14 from 195.103.124.222
Copyright 1992, 1993, 1994, 1995, 1996 Berkeley Software Design, Inc.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
BSDI BSD/OS 2.1 Kernel #12: Mon Feb 23 13:46:27 EST 1998
You have new mail.
www24:mywww/devshed#
2. Connect to MySQL. This involves the insertion of the username and password given specifically for MySQL use. This information has probably been provided to you at your request to the ISP provider.
--------------------------------------------------------------------------------www24:mywww/devshed# mysql -u devshed -p--------------------------------------------------------------------------------
Syntax: mysql -h hostname -u username -p[password]
Or
mysql -h hostname -u username --password=password
The user will then be prompted for a password, as prompted by -p.
--------------------------------------------------------------------------------Enter password: *******--------------------------------------------------------------------------------
Assuming MySQL has been correctly installed and configured, the user will see output similiar to the following:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49 to server version: 3.21.23-beta-log
Type 'help' for help.
mysql>
(Note: If an error message pertaining to "Access denied" is the result of connection attempts, you should consult the MySQL documentation included with the software, the MySQL mailing list found at http://www.mysql.com, as well as your ISP provider. These resources will aid greatly in resolving these problems.)
Once connected to the database, we are free to execute the various commands of the MySQL language. However before we are able to modify the database, we must first connect to it, via the command:
--------------------------------------------------------------------------------mysql> use devshed;
Result:
--------------------------------------------------------------------------------Database changed
Mysql>
You now are connected to the database. Note that the command was followed by a semi-colon (;). Almost all commands in MySQL are followed by a semi-colon.
At the disposition are a number of administrative commands. These commands can be viewed simply by typing help, \h or ? at the command line:
--------------------------------------------------------------------------------mysql> help
help (\h) Display this text
? (\h) Synonym for `help'
clear (\c) Clear command
connect (\r) Reconnect to the server. Optional arguments are db and host
edit (\e) Edit command with $EDITOR
exit (\) Exit mysql. Same as quit
go (\g) Send command to mysql server
print (\p) print current command
quit (\q) Quit mysql
rehash (\#) Rebuild completion hash
status (\s) Get status information from the server
use (\u) Use another database. Takes database name as argument
Connection id: 49 (Can be used with mysqladmin kill)
mysql>Let's make this simple:
a) Your book seems to assume you're doing development remotely.
b) You are not doing development remotely.
c) Therefore, you shouldn't follow every step listed in your book (i.e. ignore the stuff about Telnet).
Assuming you installed mySQL in the standard location, you can use this batch file to start mySQL on your machine:
@echo on
cd c:\mysql\bin
mysqld
@echo off
cls
Use this batch file to shut down mySQL:
@echo on
cd c:\mysql\bin
mysqladmin shutdown
@echo off
cls
You can play around without a login or password in development. For a production environment, you're going to need to set up users and grant permissions.
Spend some time reading the mySQL documentation. -
Database setup with MySQL and PHP question
Hello all,
I recently had a problem getting a report to work for a site I was updating. This site is written in PHP with a MySQL database. The application is to track customer calls to auto repair stores. The database has a lot of foreign keys because they wanted to update information in only one spot and have multiple records be updated all at once. So, I've got all the information from individual calls saved in the call_log table, and have foreign keys to reference information in other tables (for example this table lists what store received the call referencing the store table). If a store changes locations, they want to have reports automatically update with the new address, connection to conversation number, etc.
In one of the responses to my question on how to get this report to work, I was told that this could be done without using foreign keys (by Normalizing the database using mapping tables). I am still a newbie to MySQL, and after looking though a lot of manuals, tutorials, and forum posts, I am more confused now than ever.
I got the report to work using the foreign keys, but I would like to learn what I should have done with the database (and how to get the information displayed).
So for example one report would be displaying the following:
Store Reason for the Customer Call
breaks oil change shocks tune up total calls
5636 - Bloomington 2 4 0 2 8
8875 - Duluth 1 6 4 8 19
with links on the store name to pull up the information on that specific store. How would I change the database (listed below) to do this without foreign keys? Any help would be greatly appreciated.
call_log (table that contains the following:)
call_id
conv_number
date
camp_type (foreign key to the campaign table so it displays the campaign_id)
reason (foreign key to the call_reason table so it displays the reason_id)
location (foreign key to the store table so it displays the store_id)
associate
call_summary
trainig_issue (foreign key to the training_points table so it displays the training_key_id)
visit_closed
example (foreign key to the example_type table so it displays the example_id)
campaign (table that contains the following:)
campaign_id
campaign_name
campaign_promotion
campaign_coupon
campaign_startdate
campaign_enddate
call_reason (table that contains the following:)
reason_id
reason
store (table that contains the following:)
store_id
store_number
store_address
store_city
store_state
store_postalcode
store_name
store_phone
store_email
store_mgr
training_points (table that contains the following:)
training_key_id
key_issue
policy
example_type (table that contains the following:)
example_id
example_name
example_image
Thank you very much.Frankly, that is way to much of a question to be answered in detail on a forum... There's a lot involved and a lot of general database understanding required. I would highly recommend:
Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design, Second Edition -- by Michael J. Hernandez
This is an invaluable book to get you going in the right direction and on a firm foundation.
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer -
Access MySQL Database on Server with PHP Services
Hi there
There are lots of tutorials on how to connect to a MySQL database on your local machine but I'd like to access a database on my server.
When creating a new Flex Project the wizard asks me to define a Web root and a Root URL. I used '/home/ecoflexer/public_html' as Web root and 'http://ecoflexer.com' as Root URL. However, the Web root coudn't be validated. So I've chosen the local folder 'C:\ecoflexer' as Web root. Though it was possibly wrong Flash Builder generated a debug folder at the defined location. After that I went to "Connect to Data/Service" and selected "PHP Service". I tried to generate a sample using the same credentials I use for a standard PHP login script ("Server Port" was left empty). After clicking on "Connect to Database" Zend was installed and returned an error. 'gateway.php' couldn't be found on 'http://ecoflexer.com/testProject-debug/gateway.php'.
So I went into my local Web root and copied the 'testProject-debug' folder to my server to the destination the previous error mentioned. Then another error occured concerning a Zend file. So I went back and copied the whole 'ZendFramework' folder as well to my server. It connects now successfully to my database. I can chose a table but soon after that the introspection of the service fails. I modified the 'amf_config.ini' by adding 'webroot =/home/ecoflexer/public_html' and 'zend_path =/home/ecoflexer/public_html/ZendFramework/library' but it's still not working. Anithing I've done wrong or forgot to do?
Cheers!
ecoFLEXERiam doing client server application,the database is on the server,and iam doing the log in part,so i need to access the database to match the entered user name and password?so i should implement the accessing database part on the server side with the above code,right?i didn't test that i will test it now,but i thought that it's a different way
-
Problem with inserting data into mySQL database with jsp
I have a jsp page that collects infromation about a users vehicle and puts the data into a mySQL database. Iv'e been messing around with it for ages & i can't seem to get it to work even though i cannot see anything wrong with the code, which can be seen below.
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="Connections/connection.jsp" %>
<%
// *** Restrict Access To Page: Grant or deny access to this page
String MM_authorizedUsers="";
String MM_authFailedURL="login_form.jsp";
boolean MM_grantAccess=false;
if (session.getValue("MM_Username") != null && !session.getValue("MM_Username").equals("")) {
if (true || (session.getValue("MM_UserAuthorization")=="") ||
(MM_authorizedUsers.indexOf((String)session.getValue("MM_UserAuthorization")) >=0)) {
MM_grantAccess = true;
if (!MM_grantAccess) {
String MM_qsChar = "?";
if (MM_authFailedURL.indexOf("?") >= 0) MM_qsChar = "&";
String MM_referrer = request.getRequestURI();
if (request.getQueryString() != null) MM_referrer = MM_referrer + "?" + request.getQueryString();
MM_authFailedURL = MM_authFailedURL + MM_qsChar + "accessdenied=" + java.net.URLEncoder.encode(MM_referrer);
response.sendRedirect(response.encodeRedirectURL(MM_authFailedURL));
return;
String vehicle_details__registration = null;
if(request.getParameter("txt_registration") != null){ vehicle_details__registration = (String)request.getParameter("txt_registration");}
String vehicle_details__make = null;
if(request.getParameter("txt_make") != null){ vehicle_details__make = (String)request.getParameter("txt_make");}
String vehicle_details__model = null;
if(request.getParameter("txt_model") != null){ vehicle_details__model = (String)request.getParameter("txt_model");}
String vehicle_details__colour = null;
if(request.getParameter("txt_colour") != null){ vehicle_details__colour = (String)request.getParameter("txt_colour");}
String vehicle_details__tax_class = null;
if(request.getParameter("select_tax_class") != null){ vehicle_details__tax_class = (String)request.getParameter("select_tax_class");}
String vehicle_details__chasis_num = null;
if(request.getParameter("chasis_num") != null){ vehicle_details__chasis_num = (String)request.getParameter("chasis_num");}
String vehicle_details__status = null;
if(request.getParameter("radio_status") != null){ vehicle_details__status = (String)request.getParameter("radio_status");}
String owner_details__MMColParam = "1";
if (session.getValue("MM_Username") !=null) {owner_details__MMColParam = (String)session.getValue("MM_Username");}
Driver Drivervehicle_details = (Driver)Class.forName(MM_connection_DRIVER).newInstance();
Connection Connvehicle_details = DriverManager.getConnection(MM_connection_STRING,MM_connection_USERNAME,MM_connection_PASSWORD);
PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
vehicle_details.executeUpdate();
%>
<form name="add_vehicle_form" id="add_vehicle_form">
<p>Registration mark:
<input name="txt_registration" type="text" id="txt_registration">
</p>
<p>Make:
<input name="txt_make" type="text" id="txt_make">
</p>
<p>Model:
<input name="txt_model" type="text" id="txt_model">
</p>
<p>Colour:
<input name="txt_colour" type="text" id="txt_colour">
</p>
<p>Tax Class:
<select name="select_tax_class" id="select_tax_class">
<option value="AAA">Band AAA (up to 100g/km)</option>
<option value="AA">Band AA (101 - 120g/km)</option>
<option value="A">Band A (121 - 150g/km)</option>
<option value="B">Band B (151 - 165g/km)</option>
<option value="C">Band C (166 - 185g/km)</option>
<option value="D">Band D (Over 185g/km)</option>
</select>
</p>
<p>Chasis Number:
<input name="txt_chassis_num" type="text" id="txt_chassis_num">
</p>
<p>Status: active:
<input name="radio_status" type="radio" value="1" checked>
off-road
<input name="radio_status" type="radio" value="0">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<%
Connvehicle_details.close();
%>This is the error I am getting from the server
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /add_vehicle_form.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\Assignment\org\apache\jsp\add_005fvehicle_005fform_jsp.java:113: ')' expected
PreparedStatement vehicle_details = Connvehicle_details.prepareStatement("INSERT INTO vehicle_man_db.vehicle_details (registartion, make, model, colour, tax_class, chasis_num) VALUES ('"+ String vehicle_details__registration + "', '"+ String vehicle_details__make + "', '"+ String vehicle_details__model + "', '"+ String vehicle_details__colour + "', '"+ String vehicle_details__tax_class + "', '"+ String vehicle_details__chasis_num + "', '"+ String vehicle_details__status + "')");
^
1 error
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Any help would be much appreciated.
Thanksuse this ...
PreparedStatement vehicle_details =
Connvehicle_details.prepareStatement("INSERT INTO
vehicle_man_db.vehicle_details (registartion, make,
model, colour, tax_class, chasis_num) VALUES
vehicle_details .setString(1,String
vehicle_details__registration );
vehicle_details setString(2,String
vehicle_details__make );
vehicle_details .setString(3,String
vehicle_details__model );
vehicle_details .setString(4,vehicle_details__colour
vehicle_details .setString(5,String
vehicle_details__tax_class);
vehicle_details .setString(6,String
vehicle_details__chasis_num );
vehicle_details .executeQuery();Even you need a screwing up... what's the point putting that String inside. That's the bloody error.
Maybe you are looking for
-
Resetting PIX 515E 'enable' password and/or Factory Reset
We have a PIX Firewall where the last user of the device had not changed the 'enable' password and username so we are locked out of the device. I did some research and found a password reset tool that was supposed to clear the 'ena
-
I upgraded to Mountain Lion yesterday, but since doing so I find that my 1Password app will not work. I have checked for 1Password updates but there are none. Is there a compatibility issue
-
Hi Friends, i would like to insert logo on the hr form created using PE51 . can any one give me guidance to develop it. thanks and regards, kani,.
-
Computer freezes/hangs - Satellite L655
I have a Satellite L655 AMD Phenom(tm)quad core processor II P960. 64-bit. 4 gb ram. 1.80GHz (Windows 7) ..about 4 years old now.. I shouldve made this aware way back when it started because it wouldve made it a hell of a lot easier. For about a year
-
Xmltype.toObject() creates partly empty object
xmltype.toObject() creates an object of the type created when registering the XML schema but in this object all text-elements are empty. I registered an XML Schema in XDB 9i release 2. When I create an instance of xmltype using CreateSchemabasedXML,