MySQL Timestamp
Greetings again.
MySQL's manual states that whenever a row is updated and/or inserted in a table with a timestamp column, the timestamp will update automatically to the current time.
However, when I attempt to update a row from the program created with JSC, the timestamp column does not update as stated above.
Why is this?
Hi,
Could you please provide us the details as to what is actually happening, to be more precise in what format does the column get updated?
Cheers
Giri
Similar Messages
-
Convert MySQL timestamp field to a Unix timestamp
I have a process where I want to compare the current date with an expiration date that is so many months after a registration date. The registration date is stored in a MySQL timestamp format. I want to convert this to a Unix timestame so I can do the comparison with Time(). I have tried both the MySQL UNIX_TIMESTAMP and the PHP getTimestamp() functions and cannot get them to work. I have tried UNIX_TIMESTAMP both in the original SELECT statement and as a stand alone one. I also get a divide-by-zero error with the date_default_timezone_set function. I have enclosed screenshots of the code and the result of the echo at the bottom. THANKS!
You're making it far too complicated.
SELECT TO_DAYS(reg_date) - TO_DAYS(CURDATE()) AS daysleft
FROM ssregis
WHERE. . .
That will give you the number of days left until the registration expires. If it's less than 0, redirect to the renewal page.
By the way, you're laying yourself wide open to SQL injection attacks by failing to escape the input from the query string. At the very least, you should be doing this:
$entered_ss_id = mysql_real_escape_string($_GET['record_id']);
$entered_email = mysql_real_escape_string($_GET['email_address']);
However, since it looks as though you're hand-coding the script, you should be using MySQL Improved rather than PHP's deprecated MySQL functions. See http://docs.php.net/manual/en/mysqlinfo.api.choosing.php. -
MySQL timestamp formatting errors
I'm continuing to have odd formatting errors when pulling data out of a MySQL database. The one I'm currently having is with time values.
The screenshot shows that the error is being generated in the Variant to Data.vi The actual time stored in the database is 8:30AM But when converted to timestamp, I get 8:29:59.999 Unfortunately, there doesn't seem to be an easy way to 'round' this value back to what I want either.
I could go back to string outputs, since that particular error doesn't seem to propagate into a string. But that messes with the rest of my application. Going back to string output undoes a couple of days work, and leaves me with the problem of having to convert string 'time' back into timestamp that LabVIEW can understand.
The really odd thing is that 12:30 comes out as 12:30 just fine. I'm not sure why this would be. Any ideas?
Patrick Allen
Solved!
Go to Solution.There's no difference at all. Changing the properties of the constant doesn't seem to effect the output at all.
I'm trying to figure a way to convert the string back into a timestamp now via these instructions. http://zone.ni.com/reference/en-XX/help/371361B-01/glang/scan_from_string/ (example at the bottom of the page)
But my string out put is in the form 7/7/2009 8:30:00 AM and there doesn't seem to be a way at all to use the scan from string tool to covert that back into a time stamp.
Even if I manipulate my string output to be exactly 8:30:00 AM 7/7/2009, the example and any variation I can think of simply won't work. I always get the error that the data is not in the expected format.
Message Edited by pallen on 07-07-2009 12:05 PM
Patrick Allen -
hi all,
we have a MySQL database containing a TAGLOG table and the following columns:
TAGNUMBER, int
TAGVALUE, float
TAGTIMESTAMP, timestamp
a Schneider Electric Factory Cast HMI Modicon PLC module keeps logging data from the PLC onto the TAGLOG table.
we need to set-up a form to allow the user to select:
start date: ____
start time: ____
end date: ___
end time: ___
so we can build a query, send to the database and when thre Result Set is received show on a table format.
Any assistance in setting up a user friendly form to enter above dates and times will be appreciated.
thanks in advance for any assistance.
Trajanothis is a problem i need to deal with soon, and am wondering the best way for it as well.
the easiest (and quickest) would be a simple text box for each, where user types date and time as a string, with separators eg 13/03/1982 or 13:32
Otherwise three drop-down lists, one for day, one for month & one for year. Similar for time.
for me it's not worth creating or buying some fancy 'calendar' control, but i'm sure there are many available. -
Map java.sql.Timestamp to JDBC-MySQL TIMESTAMP?
Java provides the java.sql.Timestamp class specifically to be able to make
use of the greater-accuracy timestamps provided in JDBC and underlying
datastores. Is there a way to set up a Kodo mapping file such that a
persistent class with a java.sql.Timestamp field, has this field map to a
TIMESTAMP field in the underlying database table?
Thanks,
-- BryanYes, with a custom field mapping. See the example of a custom field
mapping for java.sql.Date in samples/ormapping. A mapping for timestamp
would be almost exactly the same. -
DateTimeFormatter.format() and date stored as string
Greetings,
I need to display some data in a spark data grid and would like to format a date from that data with a labelFunction calling a DateTimeFormatter's format function.
The date is stored in my ArrayCollection in the following format '2004-05-03 01:03:52.0'
my formatter is as follows
<s:DateTimeFormatter id="dateFormatter" dateTimePattern="YYYY-MM-DD" />
I would like my label function to return something like
return "Date: " + dateFormatter.format( item[column.dataField]); // where the item[column.dataField] = "2004-05-03 01:03:52.0"
The date is coming up blank. I'm thinking I need to convert the string "2004-05-03 01:03:52.0" to a Date object first, then pass that into the format() call.
Is that the way to go? If so, what's the best way to handle that?
ThanksThank you Sumesh, but the problem was with getting the string converted to a date. I found a solution on
http://polygeek.com/4137_actionscript3_batbelttime-utilities
* Convert an MySQL Timestamp to an Actionscript Date
* Thanks to Pascal Brewing [email protected] for the beautiful simplicity.
public static function convertMySQLTimeStampToASDate( time:String ):Date{
var pattern:RegExp = /[: -]/g;
time = time.replace( pattern, ',' );
var timeArray:Array = time.split( ',' );
var date:Date = new Date( timeArray[0], timeArray[1]-1, timeArray[2],
timeArray[3], timeArray[4], timeArray[5] );
return date as Date;
I pass in my string and it gets converted to a Date. I then pass the Date to the DateTimeFormatter.format() and everything works as expected.
Thanks -
Adding a timestamp field to a table (MySQL database)
I've defined a field in a MySQL table as type 'timestamp'
eg. 2010-05-25 21:36:19
When I perform an insert using coldfusion, the row doesn't change the value in the timestamp automatically
Am I better creating my own timestamp field, type varchar and manually insert my timestamp values ?No, it is a pretty bad idea to use a text field to store date-time information. It makes it much harder to do date and|or time calculations on the data.
A timestamp field does not mean you have a field that automatically inserts a timestamp on record insert and|or update. Just that you have a field that expects a 'timestamp' value which is usually a date-time value down to the millisecond precision.
You can set up the database to automatically create this value when data is inserted and|or updated, but that is more then just creating the timestamp field. And the specifics will change depending on your exact database management system. Searching the internets for information on your database managerment system of choice and auto and|or default values for fields should guide you in the correct direction.
Or you can insert timestamp data along with the other data you are inputting into the database. The now() function combined with the <cfqueryparam value="#timeData#" cfsqltype="cf_sql_timestamp"> is a useful combination to do this. -
I am using Mysql.
I want to get the TimeStamp column from database.
I used rs.getString(6) where 6 is the column index.
But it throws Exception like this:
java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 6 to TIMESTAMP.
at com.mysql.jdbc.ResultSet.getTimestampFromString(ResultSet.java:6243)
at com.mysql.jdbc.ResultSet.getTimestampInternal(ResultSet.java:6273)
at com.mysql.jdbc.ResultSet.getTimestamp(ResultSet.java:5884)
Help meThe exception you posted does not match what you said you did.
The exception specifically says that the getTimestamp() method is being called.
The error suggests to me that the database field, not your code, is a varchar. If so then you must get it as a String. And then convert it.
However I would suggest that if you want to keep a timestamp in the database then you use a field type that is appropriate for that rather than a varchar. -
Sorry if i post this in the wrong forum, but i hav posted this in jdbc topic, i haven't got any answered yet....
i hav created session table& i set the activeTime column to timestamp in mysql...
I plan to set that everytime the sessionID check the activeTime updated to current time...
1. How can i do that?
2. How can i change the format of the timestamp?
3. if i want to take the value of the seconds, how can i do that?
Thx b4 in advance...Ooh, can I, can I? JDBC is Java DataBase Connectivity.
Now as for the original questions:
1. If I understand your poorly written english, you would do that with an update/insert statement involving NOW() function.
2. You don't need to
3. Read the timestamp in your Java program and handle it there. -
Timestamp issues between mysql 5.0 and 5.1
Slightly off the dreamweaver trail here - but that's what I'm using (CS3)....here's hoping someone knows what the issue is here?
I've created some 'closing soon' and an 'expired' label for some ads I'm running, the php code is below.
<?php
// get the current timestamp
$now = time();
// get the number of seconds in seven days
$sevendays = 60*60*24*7;
// get the expiry date
$expires = $row_listJobs['job_service_expiry_date'];
if ($expires < $now) {
// display the expired image
echo '<img src="../../images/buttons_labels/expired.gif" alt="expired job" />';
} elseif ($now + $sevendays > $expires) {
// display final week image
echo '<img src="../../images/buttons_labels/closingsoon.gif" alt="job closing soon" />';
?>
This works absolutely fine when using a Recordset with a UNIX_TIMESTAMP in it, and going into the background the 'job_service_expiry_date' field in mysql5.1.30 using php5.2.8 provides a 'Default' parameter whereby I can set the Default 'as defined' followed by 0000-00-00 00:00:00. There is another date field for job posted - but this is just an ordinary date stamp. None of the fields are set up with current timestamps as I want to be able to update records with dates in the future.
The problem arises specifically with uploading this to my server (hey it's 1&1 shared host, so things are a little restricted). I'm running mysql5.0.67 with php5.2.9 here and the timezone is set to Europe/Berlin. (I'm in the UK). Looking at the background everything is the same EXCEPT for the ability to set the 'Default, as defined etc'. So, all the options I'm left with is to set it as a TIMESTAMP with Default 0000-00-00 00:00:00.
Here's the issue. On browsing the relevant page I'm now presented with an error "Function xnameofdatabasex UNIX_TIMESTAMP does not exist" and the page won't load. This didn't happen during local testing; the page displayed fine, and the php code worked perfectly.
Has anyone else come across this problem and found a way around it?
Could it be the difference in the mysql server versions that is causing the issue?? In which case any pointers on how to amend the fields, SQL query or the php code so that it does work would be really appreciated. Could it work, for example, by setting the posting date as current timestamp and then the expiry date as just a date, with the php code set to display images depending on days ahead of the posted date eg closing soon +25 days, and expired >30 days for example......need help with this as I'm no php expert!
I can add lines to the .htaccess files, but I've tried adding php_value date.timezone 'Europe/London' to it, but get a 500 error. My thinking here was that perhaps it was the timezone difference confusing the php?....but I'm not sure.
Incidently, any ideas on how to set the timezone through .htaccess without getting a 500 error (and within a dreamweaver CS3 environment) would also be welcomed.
Thanks in advance
MattThanks David
I tried adding that line to .htaccess, but received the 500 internal server error when trying to access the site. I've added the other line for the time being -hopefully that works!
The SQL looks like this:
SELECT jobs.job_id, jobs.client_id, jobs.category_id, LEFT(jobs.job_longdesc, 200) AS first200,
jobs.job_imagemini, jobs.job_salary, jobs.job_location, jobs.job_country, jobs.job_title,
jobs.job_posted_date, categories.category_id, categories.category_name,
clients.client_id, UNIX_TIMESTAMP (jobs.job_service_expiry_date) AS job_service_expiry_date,
jobs.job_featured
FROM jobs, categories, clients
WHERE jobs.client_id = clients.client_id AND jobs.category_id = categories.category_id AND jobs.job_longdesc LIKE %var1% AND jobs.job_country LIKE %var2% AND jobs.job_title LIKE %var3%
ORDER BY jobs.job_featured ASC, jobs.job_posted_date DESC, jobs.job_title
Cheers
Matt -
MySQL, DateTime and TimeStamp
I'm writing an application that updates a user's last logged on date/time in a MySQL database. I have a test case for this that:-
1. Creates a user (user1)
2. Set's the user's last logged on time and updates the database
3. Reads the user back from the database into a different object (user2)
4. Compares user1 and user2
The test case fails because user1.getLastLoginDate().getTime() is different from user2.getLastLoginDate().getTime()
Just to clarify a few things...
- The user object's lastLoginDate is of type java.util.Date
- The MySQL column type is DateTime
- When I write the date to the database I use//Where ps is a PreparedStatement
ps.setTimestamp(LAST_LOGIN_DATE_INDEX, new Timestamp(user.getLastLoginDate().getTime()));- When I read the date from the database I use//Where rs is a ResultSet
Timestamp ts = rs.getTimestamp(LAST_LOGIN_DATE_INDEX);
user.setLastLoginDate(ts.getTime() + ts.getNanos() / 1000000);However, ts.getNanos() always returns zero, making user1.getLastLoginDate().getTime() and user2.getLastLoginDate().getTime() a fraction out.
Other than breaking the test case there is no impact for my application, but I would like to understand why this is happening. Am I doing something wrong or maybe the MySQL DateTime column type doesn't store milliseconds? If the latter what are the workarounds. Should I use a different column type (e.g. a numeric based one and store the time in milliseconds)?
Thanks in advance,
SNI've checked the MySQL documentation and haven't found where it specifies the accuracy of the date time field. Although the following sentence does seem to imply this.The DATETIME type is used when you need values that contain both date and time information. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. With regards to my app / test case. The purpose of the test case was to ensure that what I write to the database is read back exactly as it was written. Because of the loss of accuracy for dates the test case was failing.
As explained this makes absolutely no difference to the app. The lastLoginDate is only used to delete infrequent users, so a difference of milliseconds is utterly irrelevant - this time.
Now that I've found a problem I would like to understand the reason / solution, in case six months down the track I come across the same problem when it does matter. I felt it was also worth posting as other people may experience the same problem too. -
Exporting a MySQL table to Excel
My users have asked for the ability to download a MySQL table to an Excel spreadsheet. Being an amateur at all this PHP stuff I googled around and found a script that is supposed to do this. It's failing with "Couldn't select database: Access denied for user 'holli10_tonybabb'@'%' to database '_admin' 1044"
It seems to be picking up an extra "@%" from somewhere
I used the same settings that I successfully used for a CRON backup job.. I'd really appreciate any insight you can suggest. The script is shown below,
Thanks
Tony
<?php
//EDIT YOUR MySQL Connection Info:
$DB_Server = "209.200.244.80"; //your MySQL Server
$DB_Username = "holli10_tonybabb"; //your MySQL User Name
$DB_Password = "abcd1234"; //your MySQL Password
$DB_DBName = "_admin"; //your MySQL Database Name
$DB_TBLName = "volunteers"; //your MySQL Table Name
//$DB_TBLName, $DB_DBName, may also be commented out & passed to the browser
//as parameters in a query string, so that this code may be easily reused for
//any MySQL table or any MySQL database on your server
//DEFINE SQL QUERY:
//you can use just about ANY kind of select statement you want -
//edit this to suit your needs!
$sql = "Select * from $DB_TBLName";
//Optional: print out title to top of Excel or Word file with Timestamp
//for when file was generated:
//set $Use_Titel = 1 to generate title, 0 not to use title
$Use_Title = 1;
//define date for title: EDIT this to create the time-format you need
$now_date = date('m-d-Y H:i');
//define title for .doc or .xls file: EDIT this if you want
$title = "Dump For Table $DB_TBLName from Database $DB_DBName on $now_date";
Leave the connection info below as it is:
just edit the above.
(Editing of code past this point recommended only for advanced users.)
//create MySQL connection
$Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password)
or die("Couldn't connect to MySQL:<br>" . mysql_error() . "<br>" . mysql_errno());
//select database
$Db = @mysql_select_db($DB_DBName, $Connect)
or die("Couldn't select database:<br>" . mysql_error(). "<br>" . mysql_errno());
//execute query
$result = @mysql_query($sql,$Connect)
or die("Couldn't execute query:<br>" . mysql_error(). "<br>" . mysql_errno());
//if this parameter is included ($w=1), file returned will be in word format ('.doc')
//if parameter is not included, file returned will be in excel format ('.xls')
if (isset($w) && ($w==1))
$file_type = "msword";
$file_ending = "doc";
}else {
$file_type = "vnd.ms-excel";
$file_ending = "xls";
//header info for browser: determines file type ('.doc' or '.xls')
header("Content-Type: application/$file_type");
header("Content-Disposition: attachment; filename=database_dump.$file_ending");
header("Pragma: no-cache");
header("Expires: 0");
/* Start of Formatting for Word or Excel */
if (isset($w) && ($w==1)) //check for $w again
/* FORMATTING FOR WORD DOCUMENTS ('.doc') */
//create title with timestamp:
if ($Use_Title == 1)
echo("$title\n\n");
//define separator (defines columns in excel & tabs in word)
$sep = "\n"; //new line character
while($row = mysql_fetch_row($result))
//set_time_limit(60); // HaRa
$schema_insert = "";
for($j=0; $j<mysql_num_fields($result);$j++)
//define field names
$field_name = mysql_field_name($result,$j);
//will show name of fields
$schema_insert .= "$field_name:\t";
if(!isset($row[$j])) {
$schema_insert .= "NULL".$sep;
elseif ($row[$j] != "") {
$schema_insert .= "$row[$j]".$sep;
else {
$schema_insert .= "".$sep;
$schema_insert = str_replace($sep."$", "", $schema_insert);
$schema_insert .= "\t";
print(trim($schema_insert));
//end of each mysql row
//creates line to separate data from each MySQL table row
print "\n----------------------------------------------------\n";
}else{
/* FORMATTING FOR EXCEL DOCUMENTS ('.xls') */
//create title with timestamp:
if ($Use_Title == 1)
echo("$title\n");
//define separator (defines columns in excel & tabs in word)
$sep = "\t"; //tabbed character
//start of printing column names as names of MySQL fields
for ($i = 0; $i < mysql_num_fields($result); $i++)
echo mysql_field_name($result,$i) . "\t";
print("\n");
//end of printing column names
//start while loop to get data
while($row = mysql_fetch_row($result))
//set_time_limit(60); // HaRa
$schema_insert = "";
for($j=0; $j<mysql_num_fields($result);$j++)
if(!isset($row[$j]))
$schema_insert .= "NULL".$sep;
elseif ($row[$j] != "")
$schema_insert .= "$row[$j]".$sep;
else
$schema_insert .= "".$sep;
$schema_insert = str_replace($sep."$", "", $schema_insert);
//following fix suggested by Josue (thanks, Josue!)
//this corrects output in excel when table fields contain \n or \r
//these two characters are now replaced with a space
$schema_insert = preg_replace("/\r\n|\n\r|\n|\r/", " ", $schema_insert);
$schema_insert .= "\t";
print(trim($schema_insert));
print "\n";
?>
<?php /*_____________________END___OF___THE___CODE______________________
get more code from http://www.fundisom.com/phparadise/
___________________________________________________________________*/ ?>Never mind. The web hosting support people people told me I had my parameters wrong. It works fine now.
-
How to store an image into MySQL db using BlazeDS and Hibernate?
Hi!
I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
thanks in advance.
Here the Code:
VisitorEntryForm.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:vo="com.visitor.vo.*"
width="600"
height="300"
defaultButton="{submitButton}"
showCloseButton="true"
creationComplete="creationCompleteHandler();"
close="PopUpManager.removePopUp(this);"
title="Visitor Entry Form" xmlns:text="flash.text.*">
<mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<vo:Visitor id="visitor"
vType="{vTypeField.text}"
vPurpose="{vPurposeField.text}"
vName="{vNameField.text}"
vAddress="{vAddressField.text}"
cPerson="{cPersonField.text}"
cAddress="{cAddressField.text}"
/>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import flash.media.Camera;
import com.visitor.vo.WebCam;
import com.visitor.vo.Base64;
import mx.core.UIComponent;
import mx.graphics.codec.JPEGEncoder;
import mx.controls.Alert;
import mx.containers.Canvas;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ValidationResultEvent;
import mx.validators.Validator;
[Bindable]
private var webCam: com.visitor.vo.WebCam;
[Bindable]
private var message:String;
[Bindable]
private var formIsValid:Boolean = false;
[Bindable]
public var formIsEmpty:Boolean;
private var focussedFormControl:DisplayObject;
private function handleSaveResult(ev:ResultEvent):void {
clearFormHandler();
validateForm(ev);
Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
// Reload the list.
parentApplication.listConsultants.loaderService.getConsultants();
PopUpManager.removePopUp(this);
private function handleFault(ev:FaultEvent):void {
message = "Error: " + ev.fault.faultCode + " \n "
+ "Detail: " + ev.fault.faultDetail + " \n "
+ "Message: " + ev.fault.faultString;
public function saveVisitor():void {
saveService.addUpdateVisitor(visitor);
private function creationCompleteHandler():void {
init();
PopUpManager.centerPopUp(this);
resetFocus();
private function resetFocus():void {
focusManager.setFocus(vTypeField);
public function validateForm(event:Event):void {
focussedFormControl = event.target as DisplayObject;
formIsValid = true;
// Check if form is empty
formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
validate(vTypeValidator);
validate(vPurposeValidator);
validate(vNameValidator);
validate(vAddressValidator);
validate(cPersonValidator);
validate(cAddressValidator);
private function validate(validator:Validator):Boolean {
var validatorSource:DisplayObject = validator.source as DisplayObject;
var suppressEvents:Boolean = (validatorSource != focussedFormControl);
var event:ValidationResultEvent = validator.validate(null, suppressEvents);
var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
formIsValid = formIsValid && currentControlIsValid;
return currentControlIsValid;
private function clearFormHandler():void {
// Clear all input fields.
vTypeField.text = "";
vPurposeField.text = "";
vNameField.text = "";
vAddressField.text = "";
cPersonField.text = "";
cAddressField.text = "";
message = "";
// Clear validation error messages.
vTypeField.errorString = "";
vPurposeField.errorString = "";
vNameField.errorString = "";
vAddressField.errorString = "";
cPersonField.errorString = "";
cAddressField.errorString = "";
formIsEmpty = true;
formIsValid = false;
resetFocus();
private function init():void {
webCam = new WebCam(97,97);
var ref:UIComponent = new UIComponent();
preview.removeAllChildren();
preview.addChild(ref);
ref.addChild(webCam);
private function takeSnapshot():void {
imageViewer.visible = true;
imageViewer.width = preview.width;
imageViewer.height = preview.height;
var uiComponent : UIComponent = new UIComponent();
uiComponent.width = webCam.width;
uiComponent.height = webCam.height;
var photoData:Bitmap = webCam.getSnapshot();
var photoBitmap:BitmapData = photoData.bitmapData;
uiComponent.addChild(photoData);
imageViewer.removeAllChildren();
imageViewer.addChild(uiComponent);
private function uploadSnapshot():void
if (imageViewer.getChildren().length > 0)
var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
private function deleteSnapshot():void
imageViewer.removeAllChildren();
]]>
</mx:Script>
<mx:StringValidator id="vTypeValidator" source="{vTypeField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vPurposeValidator" source="{vPurposeField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vNameValidator" source="{vNameField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vAddressValidator" source="{vAddressField}" property="text" minLength="5" required="true" />
<mx:StringValidator id="cPersonValidator" source="{cPersonField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="cAddressValidator" source="{cAddressField}" property="text" minLength="5" required="true" />
<mx:Grid width="575" height="211">
<mx:GridRow width="575" height="211">
<mx:GridItem width="301" height="235">
<mx:Form width="301" height="208">
<mx:FormItem label="Visitor's Type">
<mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
<mx:Array>
<mx:String></mx:String>
<mx:String>Contractor</mx:String>
<mx:String>Supplier</mx:String>
<mx:String>Transporter</mx:String>
<mx:String>Plant</mx:String>
<mx:String>Non-Plant</mx:String>
</mx:Array>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Visit Purpose">
<mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
<mx:Array>
<mx:String></mx:String>
<mx:String>Official</mx:String>
<mx:String>Personal</mx:String>
</mx:Array>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Visitor's Name">
<mx:TextInput id="vNameField" text="{visitor.vName}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Address">
<mx:TextInput id="vAddressField" text="{visitor.vAddress}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Contact Person">
<mx:TextInput id="cPersonField" text="{visitor.cPerson}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Address">
<mx:TextInput id="cAddressField" text="{visitor.cAddress}" change="validateForm(event);"/>
</mx:FormItem>
</mx:Form>
</mx:GridItem>
<mx:GridItem width="264" height="193">
<mx:Grid width="241" height="206">
<mx:GridRow width="100%" height="100%">
<mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
<mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
<mx:Panel width="100" height="132" title="Preview" id="imageViewer" layout="absolute"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="27" >
<mx:GridItem width="100%" height="100%" horizontalAlign="center">
<mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
click="takeSnapshot();"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%" horizontalAlign="center">
<mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
click="deleteSnapshot();"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
<mx:ControlBar height="40" horizontalAlign="center">
<mx:Button label="Save Visitor" id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
<mx:Button label="Clear form" enabled="{!formIsEmpty}" click="clearFormHandler();" />
<mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
<mx:Label width="211" id="state"/>
</mx:ControlBar>
<mx:Text text="{message}" fontWeight="bold" width="300"/>
</mx:TitleWindow>
ListVisitors.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:view="com.visitor.view.*"
width="100%"
height="100%"
title="Visitor Management System - Found {visitorRecords} visitors."
creationComplete="loadVisitors();">
<mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<mx:Script>
<![CDATA[
import com.visitor.vo.Visitor;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
[Bindable]
private var message:String;
[Bindable]
private var visitors:ArrayCollection = new ArrayCollection();
[Bindable]
private var visitorRecords:int = 0;
public function loadVisitors():void {
loaderService.getVisitors();
private function deleteVisitor():void {
if(dataGrid.selectedItem != null) {
var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
deleteService.deleteVisitor(selectedItem.visitorId);
private function createVisitor():void {
var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
titleWindow.setStyle("borderAlpha", 0.9);
titleWindow.formIsEmpty = true;
private function updateVisitor():void {
var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
titleWindow.setStyle("borderAlpha", 0.9);
titleWindow.visitor = dataGrid.selectedItem as Visitor;
titleWindow.formIsEmpty = false;
private function handleLoadResult(ev:ResultEvent):void {
visitors = ev.result as ArrayCollection;
visitorRecords = visitors.length;
private function handleDeleteResult(ev:ResultEvent):void {
Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
loadVisitors();
private function handleFault(ev:FaultEvent):void {
message = "Error: "
+ ev.fault.faultCode + " - "
+ ev.fault.faultDetail + " - "
+ ev.fault.faultString;
]]>
</mx:Script>
<mx:VBox width="100%" height="100%">
<mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
<mx:DataGrid
id="dataGrid"
width="100%"
height="100%"
dataProvider="{visitors}"
doubleClickEnabled="true"
doubleClick="updateVisitor()" >
<mx:columns>
<mx:DataGridColumn dataField="visitorId" headerText="Visitor ID" width="100"/>
<mx:DataGridColumn dataField="vType" headerText="Visitor's Type" />
<mx:DataGridColumn dataField="vPurpose" headerText="Visit Purpose" />
<mx:DataGridColumn dataField="vName" headerText="Visitor's Name" />
<mx:DataGridColumn dataField="vAddress" headerText="Visitor's Address" />
<mx:DataGridColumn dataField="cPerson" headerText="Contact Person" />
<mx:DataGridColumn dataField="cAddress" headerText="Contact Address" />
<mx:DataGridColumn dataField="timeIn" headerText="Time-In" />
<mx:DataGridColumn dataField="timeOut" headerText="Time-Out" />
<mx:DataGridColumn dataField="vPhoto" headerText="Visitor's Photo" />
</mx:columns>
</mx:DataGrid>
<mx:ControlBar horizontalAlign="center">
<mx:Button label="Create Visitor" click="createVisitor()" toolTip="Create a new visitor and store it in the database." />
<mx:Button label="Update Visitor" click="updateVisitor()" enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
<mx:Button label="Delete Visitor" click="deleteVisitor()" enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
<mx:Button label="Reload Data" click="loadVisitors()" toolTip="Reload the visitor list from the database." />
</mx:ControlBar>
</mx:VBox>
</mx:Panel>
Visitor.as
package com.visitor.vo
import mx.controls.Image;
import spark.primitives.BitmapImage;
[Bindable]
[RemoteClass(alias="com.visitor.Visitor")]
public class Visitor
public function Visitor()
public var visitorId:Number;
public var vType:String;
public var vPurpose:String;
public var vName:String;
public var vAddress:String;
public var cPerson:String;
public var cAddress:String;
public var timeIn:Date;
public var timeOut:Date;
public var vPhoto: Image;
Visitor.java
package com.visitor;
import java.sql.Blob;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
@Entity
@Table(name = "visitors")
@NamedQueries( {
@NamedQuery(name = "visitors.findAll", query = "from Visitor"),
@NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
public class Visitor {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "visitorId", nullable = false)
private Long visitorId;
@Basic
@Index(name = "vType_idx_1")
@Column(name = "vType", nullable = true, unique = false)
private String vType;
@Basic
@Column(name = "vPurpose", nullable = true, unique = false)
private String vPurpose;
@Basic
@Column(name = "vName", nullable = true, unique = false)
private String vName;
@Basic
@Column(name = "vAddress", nullable = true, unique = false)
private String vAddress;
@Basic
@Column(name = "cPerson", nullable = true, unique = false)
private String cPerson;
@Basic
@Column(name = "cAddress", nullable = true, unique = false)
private String cAddress;
@Basic
@Column(name = "timeIn", nullable = false, unique = false)
private Timestamp timeIn;
@Basic
@Column(name = "timeOut", nullable = true, unique = false)
private Timestamp timeOut;
@Basic
@Column(name = "vPhoto", nullable = true, unique = false)
private Blob vPhoto;
public Visitor() {
super();
public Long getVisitorId() {
return visitorId;
public void setVisitorId(Long visitorId) {
this.visitorId = visitorId;
public String getvType() {
return vType;
public void setvType(String vType) {
this.vType = vType;
public String getvPurpose() {
return vPurpose;
public void setvPurpose(String vPurpose) {
this.vPurpose = vPurpose;
public String getvName() {
return vName;
public void setvName(String vName) {
this.vName = vName;
public String getvAddress() {
return vAddress;
public void setvAddress(String vAddress) {
this.vAddress = vAddress;
public String getcPerson() {
return cPerson;
public void setcPerson(String cPerson) {
this.cPerson = cPerson;
public String getcAddress() {
return cAddress;
public void setcAddress(String cAddress) {
this.cAddress = cAddress;
public Timestamp getTimeIn() {
return timeIn;
public void setTimeIn(Timestamp timeIn) {
this.timeIn = timeIn;
public Timestamp getTimeOut() {
return timeOut;
public void setTimeOut(Timestamp timeOut) {
this.timeOut = timeOut;
public Blob getvPhoto() {
return vPhoto;
public void setvPhoto(Blob vPhoto) {
this.vPhoto = vPhoto;
VisitorService.java
package com.visitor;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.Query;
import org.apache.log4j.Logger;
public class VisitorService {
private static final String PERSISTENCE_UNIT = "visitor_db";
private static Logger logger = Logger.getLogger(VisitorService.class);
public VisitorService() {
super();
public List<Visitor> getvisitors() {
logger.debug("** getVisitors called...");
EntityManagerFactory entityManagerFactory = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = entityManagerFactory.createEntityManager();
Query findAllQuery = em.createNamedQuery("visitors.findAll");
List<Visitor> visitors = findAllQuery.getResultList();
if (visitors != null)
logger.debug("** Found " + visitors.size() + " records:");
return visitors;
public void addUpdateVisitor(Visitor visitor) throws Exception {
logger.debug("** addUpdateVisitor called...");
EntityManagerFactory emf = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = emf.createEntityManager();
// When passing Boolean and Number values from the Flash client to a
// Java object, Java interprets null values as the default values for
// primitive types; for example, 0 for double, float, long, int, short,
// byte.
if (visitor.getVisitorId() == null || visitor.getVisitorId() == 0) {
// New consultant is created
visitor.setVisitorId(null);
visitor.setTimeIn(new Timestamp(new Date().getTime()));
} else {
visitor.setTimeOut(new Timestamp(new Date().getTime()));
// Existing consultant is updated - do nothing.
EntityTransaction tx = em.getTransaction();
tx.begin();
try {
em.merge(visitor);
tx.commit();
} catch (Exception e) {
logger.error("** Error: " + e.getMessage());
tx.rollback();
throw new Exception(e.getMessage());
} finally {
logger.info("** Closing Entity Manager.");
em.close();
public void deleteVisitor(Long visitorId) {
logger.debug("** deleteVisitor called...");
EntityManagerFactory emf = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = emf.createEntityManager();
Query q = em.createNamedQuery("visitors.byId");
q.setParameter("visitorId", visitorId);
Visitor visitor = (Visitor) q.getSingleResult();
if (visitor != null) {
EntityTransaction tx = em.getTransaction();
tx.begin();
try {
em.remove(visitor);
tx.commit();
} catch (Exception e) {
logger.error("** Error: " + e.getMessage());
tx.rollback();
} finally {
logger.info("** Closing Entity Manager.");
em.close();
remoting-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true" />
</adapters>
<default-channels>
<channel ref="my-amf" />
</default-channels>
<!-- ADC Demo application -->
<destination id="visitorService">
<properties>
<source>com.visitor.VisitorService</source>
</properties>
</destination>
</service>Hi!
I am using Flash Builder 4.6, BlazeDS, and Hibernate. How to store a webcam snapshot into the MySql Database. I stored Form Items by using RemoteObject into the database. But I failed to store webcam snapshot. I captured that image on Panel component.I converted that image to ByteArray. Now I want to save that image into the database. Please help me in this regard.
thanks in advance.
Here the Code:
VisitorEntryForm.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:vo="com.visitor.vo.*"
width="600"
height="300"
defaultButton="{submitButton}"
showCloseButton="true"
creationComplete="creationCompleteHandler();"
close="PopUpManager.removePopUp(this);"
title="Visitor Entry Form" xmlns:text="flash.text.*">
<mx:RemoteObject id="saveService" destination="visitorService" result="handleSaveResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<vo:Visitor id="visitor"
vType="{vTypeField.text}"
vPurpose="{vPurposeField.text}"
vName="{vNameField.text}"
vAddress="{vAddressField.text}"
cPerson="{cPersonField.text}"
cAddress="{cAddressField.text}"
/>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import flash.media.Camera;
import com.visitor.vo.WebCam;
import com.visitor.vo.Base64;
import mx.core.UIComponent;
import mx.graphics.codec.JPEGEncoder;
import mx.controls.Alert;
import mx.containers.Canvas;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.events.ValidationResultEvent;
import mx.validators.Validator;
[Bindable]
private var webCam: com.visitor.vo.WebCam;
[Bindable]
private var message:String;
[Bindable]
private var formIsValid:Boolean = false;
[Bindable]
public var formIsEmpty:Boolean;
private var focussedFormControl:DisplayObject;
private function handleSaveResult(ev:ResultEvent):void {
clearFormHandler();
validateForm(ev);
Alert.show("Visitor successfully created/updated.", "Information", Alert.OK, null, null, null, Alert.OK);
// Reload the list.
parentApplication.listConsultants.loaderService.getConsultants();
PopUpManager.removePopUp(this);
private function handleFault(ev:FaultEvent):void {
message = "Error: " + ev.fault.faultCode + " \n "
+ "Detail: " + ev.fault.faultDetail + " \n "
+ "Message: " + ev.fault.faultString;
public function saveVisitor():void {
saveService.addUpdateVisitor(visitor);
private function creationCompleteHandler():void {
init();
PopUpManager.centerPopUp(this);
resetFocus();
private function resetFocus():void {
focusManager.setFocus(vTypeField);
public function validateForm(event:Event):void {
focussedFormControl = event.target as DisplayObject;
formIsValid = true;
// Check if form is empty
formIsEmpty = (vTypeField.text == "" && vPurposeField.text == "" && vNameField.text == "" && vAddressField.text == "" && cPersonField.text == "" && cAddressField.text == "");
validate(vTypeValidator);
validate(vPurposeValidator);
validate(vNameValidator);
validate(vAddressValidator);
validate(cPersonValidator);
validate(cAddressValidator);
private function validate(validator:Validator):Boolean {
var validatorSource:DisplayObject = validator.source as DisplayObject;
var suppressEvents:Boolean = (validatorSource != focussedFormControl);
var event:ValidationResultEvent = validator.validate(null, suppressEvents);
var currentControlIsValid:Boolean = (event.type == ValidationResultEvent.VALID);
formIsValid = formIsValid && currentControlIsValid;
return currentControlIsValid;
private function clearFormHandler():void {
// Clear all input fields.
vTypeField.text = "";
vPurposeField.text = "";
vNameField.text = "";
vAddressField.text = "";
cPersonField.text = "";
cAddressField.text = "";
message = "";
// Clear validation error messages.
vTypeField.errorString = "";
vPurposeField.errorString = "";
vNameField.errorString = "";
vAddressField.errorString = "";
cPersonField.errorString = "";
cAddressField.errorString = "";
formIsEmpty = true;
formIsValid = false;
resetFocus();
private function init():void {
webCam = new WebCam(97,97);
var ref:UIComponent = new UIComponent();
preview.removeAllChildren();
preview.addChild(ref);
ref.addChild(webCam);
private function takeSnapshot():void {
imageViewer.visible = true;
imageViewer.width = preview.width;
imageViewer.height = preview.height;
var uiComponent : UIComponent = new UIComponent();
uiComponent.width = webCam.width;
uiComponent.height = webCam.height;
var photoData:Bitmap = webCam.getSnapshot();
var photoBitmap:BitmapData = photoData.bitmapData;
uiComponent.addChild(photoData);
imageViewer.removeAllChildren();
imageViewer.addChild(uiComponent);
private function uploadSnapshot():void
if (imageViewer.getChildren().length > 0)
var uic:UIComponent = imageViewer.getChildAt(0) as UIComponent;
var bitmap:Bitmap = uic.getChildAt(0) as Bitmap;
var jpgEncoder:JPEGEncoder = new JPEGEncoder(75);
var jpgBytes:ByteArray = jpgEncoder.encode(bitmap.bitmapData);
private function deleteSnapshot():void
imageViewer.removeAllChildren();
]]>
</mx:Script>
<mx:StringValidator id="vTypeValidator" source="{vTypeField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vPurposeValidator" source="{vPurposeField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vNameValidator" source="{vNameField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="vAddressValidator" source="{vAddressField}" property="text" minLength="5" required="true" />
<mx:StringValidator id="cPersonValidator" source="{cPersonField}" property="text" minLength="2" required="true" />
<mx:StringValidator id="cAddressValidator" source="{cAddressField}" property="text" minLength="5" required="true" />
<mx:Grid width="575" height="211">
<mx:GridRow width="575" height="211">
<mx:GridItem width="301" height="235">
<mx:Form width="301" height="208">
<mx:FormItem label="Visitor's Type">
<mx:ComboBox id="vTypeField" text="{visitor.vType}" change="validateForm(event);" editable="true">
<mx:Array>
<mx:String></mx:String>
<mx:String>Contractor</mx:String>
<mx:String>Supplier</mx:String>
<mx:String>Transporter</mx:String>
<mx:String>Plant</mx:String>
<mx:String>Non-Plant</mx:String>
</mx:Array>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Visit Purpose">
<mx:ComboBox id="vPurposeField" text="{visitor.vPurpose}" change="validateForm(event);" editable="true">
<mx:Array>
<mx:String></mx:String>
<mx:String>Official</mx:String>
<mx:String>Personal</mx:String>
</mx:Array>
</mx:ComboBox>
</mx:FormItem>
<mx:FormItem label="Visitor's Name">
<mx:TextInput id="vNameField" text="{visitor.vName}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Address">
<mx:TextInput id="vAddressField" text="{visitor.vAddress}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Contact Person">
<mx:TextInput id="cPersonField" text="{visitor.cPerson}" change="validateForm(event);"/>
</mx:FormItem>
<mx:FormItem label="Address">
<mx:TextInput id="cAddressField" text="{visitor.cAddress}" change="validateForm(event);"/>
</mx:FormItem>
</mx:Form>
</mx:GridItem>
<mx:GridItem width="264" height="193">
<mx:Grid width="241" height="206">
<mx:GridRow width="100%" height="100%">
<mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
<mx:Panel width="100" height="132" title="Snap" id="preview" layout="absolute"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
<mx:Panel width="100" height="132" title="Preview" id="imageViewer" layout="absolute"/>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="27" >
<mx:GridItem width="100%" height="100%" horizontalAlign="center">
<mx:Button id="snapshot" x="2" width="106" height="27" label="Snap"
click="takeSnapshot();"/>
</mx:GridItem>
<mx:GridItem width="100%" height="100%" horizontalAlign="center">
<mx:Button id="deleteButton" x="1" width="106" height="27" label="Delete"
click="deleteSnapshot();"/>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
<mx:ControlBar height="40" horizontalAlign="center">
<mx:Button label="Save Visitor" id="submitButton" enabled="{formIsValid}" click="saveVisitor();" />
<mx:Button label="Clear form" enabled="{!formIsEmpty}" click="clearFormHandler();" />
<mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
<mx:Label width="211" id="state"/>
</mx:ControlBar>
<mx:Text text="{message}" fontWeight="bold" width="300"/>
</mx:TitleWindow>
ListVisitors.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:view="com.visitor.view.*"
width="100%"
height="100%"
title="Visitor Management System - Found {visitorRecords} visitors."
creationComplete="loadVisitors();">
<mx:RemoteObject id="loaderService" destination="visitorService" result="handleLoadResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<mx:RemoteObject id="deleteService" destination="visitorService" result="handleDeleteResult(event)" fault="handleFault(event)" showBusyCursor="true" />
<mx:Script>
<![CDATA[
import com.visitor.vo.Visitor;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
[Bindable]
private var message:String;
[Bindable]
private var visitors:ArrayCollection = new ArrayCollection();
[Bindable]
private var visitorRecords:int = 0;
public function loadVisitors():void {
loaderService.getVisitors();
private function deleteVisitor():void {
if(dataGrid.selectedItem != null) {
var selectedItem:Visitor = dataGrid.selectedItem as Visitor;
deleteService.deleteVisitor(selectedItem.visitorId);
private function createVisitor():void {
var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
titleWindow.setStyle("borderAlpha", 0.9);
titleWindow.formIsEmpty = true;
private function updateVisitor():void {
var titleWindow:VisitorEntryForm = VisitorEntryForm(PopUpManager.createPopUp(this, VisitorEntryForm, true));
titleWindow.setStyle("borderAlpha", 0.9);
titleWindow.visitor = dataGrid.selectedItem as Visitor;
titleWindow.formIsEmpty = false;
private function handleLoadResult(ev:ResultEvent):void {
visitors = ev.result as ArrayCollection;
visitorRecords = visitors.length;
private function handleDeleteResult(ev:ResultEvent):void {
Alert.show("The visitor has been deleted.", "Information", Alert.OK, null, null, null, Alert.OK);
loadVisitors();
private function handleFault(ev:FaultEvent):void {
message = "Error: "
+ ev.fault.faultCode + " - "
+ ev.fault.faultDetail + " - "
+ ev.fault.faultString;
]]>
</mx:Script>
<mx:VBox width="100%" height="100%">
<mx:Label text="{message}" fontWeight="bold" includeInLayout="false" />
<mx:DataGrid
id="dataGrid"
width="100%"
height="100%"
dataProvider="{visitors}"
doubleClickEnabled="true"
doubleClick="updateVisitor()" >
<mx:columns>
<mx:DataGridColumn dataField="visitorId" headerText="Visitor ID" width="100"/>
<mx:DataGridColumn dataField="vType" headerText="Visitor's Type" />
<mx:DataGridColumn dataField="vPurpose" headerText="Visit Purpose" />
<mx:DataGridColumn dataField="vName" headerText="Visitor's Name" />
<mx:DataGridColumn dataField="vAddress" headerText="Visitor's Address" />
<mx:DataGridColumn dataField="cPerson" headerText="Contact Person" />
<mx:DataGridColumn dataField="cAddress" headerText="Contact Address" />
<mx:DataGridColumn dataField="timeIn" headerText="Time-In" />
<mx:DataGridColumn dataField="timeOut" headerText="Time-Out" />
<mx:DataGridColumn dataField="vPhoto" headerText="Visitor's Photo" />
</mx:columns>
</mx:DataGrid>
<mx:ControlBar horizontalAlign="center">
<mx:Button label="Create Visitor" click="createVisitor()" toolTip="Create a new visitor and store it in the database." />
<mx:Button label="Update Visitor" click="updateVisitor()" enabled="{dataGrid.selectedItem}" toolTip="Update an existing database visitor." />
<mx:Button label="Delete Visitor" click="deleteVisitor()" enabled="{dataGrid.selectedItem}" toolTip="Delete the visitor from the database." />
<mx:Button label="Reload Data" click="loadVisitors()" toolTip="Reload the visitor list from the database." />
</mx:ControlBar>
</mx:VBox>
</mx:Panel>
Visitor.as
package com.visitor.vo
import mx.controls.Image;
import spark.primitives.BitmapImage;
[Bindable]
[RemoteClass(alias="com.visitor.Visitor")]
public class Visitor
public function Visitor()
public var visitorId:Number;
public var vType:String;
public var vPurpose:String;
public var vName:String;
public var vAddress:String;
public var cPerson:String;
public var cAddress:String;
public var timeIn:Date;
public var timeOut:Date;
public var vPhoto: Image;
Visitor.java
package com.visitor;
import java.sql.Blob;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Index;
@Entity
@Table(name = "visitors")
@NamedQueries( {
@NamedQuery(name = "visitors.findAll", query = "from Visitor"),
@NamedQuery(name = "visitors.byId", query = "select v from Visitor v where v.visitorId= :visitorId") })
public class Visitor {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "visitorId", nullable = false)
private Long visitorId;
@Basic
@Index(name = "vType_idx_1")
@Column(name = "vType", nullable = true, unique = false)
private String vType;
@Basic
@Column(name = "vPurpose", nullable = true, unique = false)
private String vPurpose;
@Basic
@Column(name = "vName", nullable = true, unique = false)
private String vName;
@Basic
@Column(name = "vAddress", nullable = true, unique = false)
private String vAddress;
@Basic
@Column(name = "cPerson", nullable = true, unique = false)
private String cPerson;
@Basic
@Column(name = "cAddress", nullable = true, unique = false)
private String cAddress;
@Basic
@Column(name = "timeIn", nullable = false, unique = false)
private Timestamp timeIn;
@Basic
@Column(name = "timeOut", nullable = true, unique = false)
private Timestamp timeOut;
@Basic
@Column(name = "vPhoto", nullable = true, unique = false)
private Blob vPhoto;
public Visitor() {
super();
public Long getVisitorId() {
return visitorId;
public void setVisitorId(Long visitorId) {
this.visitorId = visitorId;
public String getvType() {
return vType;
public void setvType(String vType) {
this.vType = vType;
public String getvPurpose() {
return vPurpose;
public void setvPurpose(String vPurpose) {
this.vPurpose = vPurpose;
public String getvName() {
return vName;
public void setvName(String vName) {
this.vName = vName;
public String getvAddress() {
return vAddress;
public void setvAddress(String vAddress) {
this.vAddress = vAddress;
public String getcPerson() {
return cPerson;
public void setcPerson(String cPerson) {
this.cPerson = cPerson;
public String getcAddress() {
return cAddress;
public void setcAddress(String cAddress) {
this.cAddress = cAddress;
public Timestamp getTimeIn() {
return timeIn;
public void setTimeIn(Timestamp timeIn) {
this.timeIn = timeIn;
public Timestamp getTimeOut() {
return timeOut;
public void setTimeOut(Timestamp timeOut) {
this.timeOut = timeOut;
public Blob getvPhoto() {
return vPhoto;
public void setvPhoto(Blob vPhoto) {
this.vPhoto = vPhoto;
VisitorService.java
package com.visitor;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.persistence.Query;
import org.apache.log4j.Logger;
public class VisitorService {
private static final String PERSISTENCE_UNIT = "visitor_db";
private static Logger logger = Logger.getLogger(VisitorService.class);
public VisitorService() {
super();
public List<Visitor> getvisitors() {
logger.debug("** getVisitors called...");
EntityManagerFactory entityManagerFactory = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = entityManagerFactory.createEntityManager();
Query findAllQuery = em.createNamedQuery("visitors.findAll");
List<Visitor> visitors = findAllQuery.getResultList();
if (visitors != null)
logger.debug("** Found " + visitors.size() + " records:");
return visitors;
public void addUpdateVisitor(Visitor visitor) throws Exception {
logger.debug("** addUpdateVisitor called...");
EntityManagerFactory emf = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = emf.createEntityManager();
// When passing Boolean and Number values from the Flash client to a
// Java object, Java interprets null values as the default values for
// primitive types; for example, 0 for double, float, long, int, short,
// byte.
if (visitor.getVisitorId() == null || visitor.getVisitorId() == 0) {
// New consultant is created
visitor.setVisitorId(null);
visitor.setTimeIn(new Timestamp(new Date().getTime()));
} else {
visitor.setTimeOut(new Timestamp(new Date().getTime()));
// Existing consultant is updated - do nothing.
EntityTransaction tx = em.getTransaction();
tx.begin();
try {
em.merge(visitor);
tx.commit();
} catch (Exception e) {
logger.error("** Error: " + e.getMessage());
tx.rollback();
throw new Exception(e.getMessage());
} finally {
logger.info("** Closing Entity Manager.");
em.close();
public void deleteVisitor(Long visitorId) {
logger.debug("** deleteVisitor called...");
EntityManagerFactory emf = Persistence
.createEntityManagerFactory(PERSISTENCE_UNIT);
EntityManager em = emf.createEntityManager();
Query q = em.createNamedQuery("visitors.byId");
q.setParameter("visitorId", visitorId);
Visitor visitor = (Visitor) q.getSingleResult();
if (visitor != null) {
EntityTransaction tx = em.getTransaction();
tx.begin();
try {
em.remove(visitor);
tx.commit();
} catch (Exception e) {
logger.error("** Error: " + e.getMessage());
tx.rollback();
} finally {
logger.info("** Closing Entity Manager.");
em.close();
remoting-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true" />
</adapters>
<default-channels>
<channel ref="my-amf" />
</default-channels>
<!-- ADC Demo application -->
<destination id="visitorService">
<properties>
<source>com.visitor.VisitorService</source>
</properties>
</destination>
</service> -
Has anyone run the connection pooling for mysql & tomcat successfully?
I'm trying to set up connection pooling. I'm following the how-to page at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
But when i test the DBTest/test.jsp file, tomcat displays an error =
could not load jdbc driver class 'null'(msdos)
i have placed all the required .jar files in the tomcat lib.
below is the cofiguration i did to the server.xml file
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Uncomment these entries to enable JMX MBeans support -->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible
within that Container). Normally, that Container is an "Engine",
but this is not required.
Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 4.0 documentation bundle for more detailed
instructions):
* Download and install JSSE 1.0.2 or later, and put the JAR files
into "$JAVA_HOME/jre/lib/ext".
* Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
with a password value of "changeit" for both the certificate and
the keystore itself.
By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8081 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
-->
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8082" minProcessors="5" maxProcessors="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" useURIValidationHack="false" />
-->
<!-- Define a non-SSL legacy HTTP/1.1 Test Connector on port 8083 -->
<!--
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8083" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- Define a non-SSL HTTP/1.0 Test Connector on port 8084 -->
<!--
<Connector className="org.apache.catalina.connector.http10.HttpConnector"
port="8084" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Standalone" defaultHost="localhost" debug="0">
<!-- The request dumper valve dumps useful debugging information about
the request headers and cookies that were received, and the response
headers and cookies that were sent, for all requests received by
this instance of Tomcat. If you care only about requests to a
particular virtual host, or a particular application, nest this
element inside the corresponding <Host> or <Context> entry instead.
For a similar mechanism that is portable to all Servlet 2.3
containers, check out the "RequestDumperFilter" Filter in the
example application (the source for this filter may be found in
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
Request dumping is disabled by default. Uncomment the following
element to enable it. -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="/my-jsp" docBase="c:\JSP-Files" debug="0"
privileged="true" reloadable="true" />
<Context path="" docBase="c:\Inetpub\wwwroot" debug="0" privileged="true" />
<Context path="/sharon" docBase="C:\Tomcat 4.1\webapps\sharon" debug="0" privileged="true" />
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across all web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
-->
<!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Define properties for each web application. This is only needed
if you want to set non-default properties, or have web application
document roots in places other than the virtual host's appBase
directory. -->
<!-- Tomcat Root Context -->
<!--
<Context path="" docBase="ROOT" debug="0"/>
-->
<!-- Tomcat Examples Context -->
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<!-- If you wanted the examples app to be able to edit the
user database, you would uncomment the following entry.
Of course, you would want to enable security on the
application as well, so this is not done by default!
The database object could be accessed like this:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
UserDatabase database =
(UserDatabase) envCtx.lookup("userDatabase");
-->
<!--
<ResourceLink name="userDatabase" global="UserDatabase"
type="org.apache.catalina.UserDatabase"/>
-->
<!-- PersistentManager: Uncomment the section below to test Persistent
Sessions.
saveOnRestart: If true, all active sessions will be saved
to the Store when Catalina is shutdown, regardless of
other settings. All Sessions found in the Store will be
loaded on startup. Sessions past their expiration are
ignored in both cases.
maxActiveSessions: If 0 or greater, having too many active
sessions will result in some being swapped out. minIdleSwap
limits this. -1 means unlimited sessions are allowed.
0 means sessions will almost always be swapped out after
use - this will be noticeably slow for your users.
minIdleSwap: Sessions must be idle for at least this long
(in seconds) before they will be swapped out due to
maxActiveSessions. This avoids thrashing when the site is
highly active. -1 or 0 means there is no minimum - sessions
can be swapped out at any time.
maxIdleSwap: Sessions will be swapped out if idle for this
long (in seconds). If minIdleSwap is higher, then it will
override this. This isn't exact: it is checked periodically.
-1 means sessions won't be swapped out for this reason,
although they may be swapped out for maxActiveSessions.
If set to >= 0, guarantees that all sessions found in the
Store will be loaded on startup.
maxIdleBackup: Sessions will be backed up (saved to the Store,
but left in active memory) if idle for this long (in seconds),
and all sessions found in the Store will be loaded on startup.
If set to -1 sessions will not be backed up, 0 means they
should be backed up shortly after being used.
To clear sessions from the Store, set maxActiveSessions, maxIdleSwap,
and minIdleBackup all to -1, saveOnRestart to false, then restart
Catalina.
-->
<!--
<Manager className="org.apache.catalina.session.PersistentManager"
debug="0"
saveOnRestart="true"
maxActiveSessions="-1"
minIdleSwap="-1"
maxIdleSwap="-1"
maxIdleBackup="-1">
<Store className="org.apache.catalina.session.FileStore"/>
</Manager>
-->
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<Resource name="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>user</name>
<value>javauser</value>
</parameter>
<parameter>
<name>password</name>
<value>javadude</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue"
type="java.lang.Integer"/>
</Context>
</Host>
</Engine>
</Service>
<!-- The MOD_WEBAPP connector is used to connect Apache 1.3 with Tomcat 4.0
as its servlet container. Please read the README.txt file coming with
the WebApp Module distribution on how to build it.
(Or check out the "jakarta-tomcat-connectors/webapp" CVS repository)
To configure the Apache side, you must ensure that you have the
"ServerName" and "Port" directives defined in "httpd.conf". Then,
lines like these to the bottom of your "httpd.conf" file:
LoadModule webapp_module libexec/mod_webapp.so
WebAppConnection warpConnection warp localhost:8008
WebAppDeploy examples warpConnection /examples/
The next time you restart Apache (after restarting Tomcat, if needed)
the connection will be established, and all applications you make
visible via "WebAppDeploy" directives can be accessed through Apache.
-->
<!-- Define an Apache-Connector Service -->
<!--
<Service name="Tomcat-Apache">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8008" minProcessors="5" maxProcessors="75"
enableLookups="true" appBase="webapps"
acceptCount="10" debug="0"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
</Engine>
</Service>
-->
</Server>
Pleas4 help!!!you have your driver jar in Tomcat\common\lib?
if so, check your classpath, it could be that. -
Dg4odbc 11.2 to mysql desc table issue, query return only one record
<h2>Hi,
I have the following set up:
11g R2 RAC oracle database, dg4odbc 11.2, UnixODBC 2.3 driver manager, MySQL ODBC 5.1.7 Driver on 64 bit Suse SLES 11 server.
Remote database MySQL version 5.0.67 running on 32 bit linux server.
I am having the following Issues:
1. When desc table, sometimes only the first field is shown:
SQL> desc sub_index@mybilltracker;
Name Null? Type
subject_id NOT NULL NUMBER(20)
SQL> desc "sub_index"@mybilltracker;
Name Null? Type
subject_id NOT NULL NUMBER(20)
Some other times I am able to see the correct table definition:
SQL> desc "sub_index"@mybilltracker;
Name Null? Type
subject_id NOT NULL NUMBER(20)
sess_id NUMBER(10)
sess_yr NUMBER(10)
subject_name VARCHAR2(255)
SQL> desc sub_index@mybilltracker;
Name Null? Type
subject_id NOT NULL NUMBER(20)
2. Select count(*) returns the total number of rows correctly. Select * or Select "field name" from table returns only one row:
SQL> select count(*) from "mbt_user"@mybilltracker;
COUNT(*)
2
SQL> select "user_id", "email" from "mbt_user"@mybilltracker; _(always return only one record!)_
user_id email
1 [email protected]
Has anybody seen this? Can somebody help me pinpoint the problem? Thank you!
</h2>
=======================================
<h2>Params in odbc.ini:[ODBC Data Sources]
myodbc5 = MyODBC 5.17 Driver DSN
[myodbc5]
Driver = /usr/local/lib/libmyodbc5.so
Description = Connector/ODBC 5.17 Driver DSN
SERVER = *serverip
PORT = *port
USER = *user
Password = *password
Database = MyBillTracker
#CHARSET = latin1
QuotedId = Yes
AnsiNPW = Yes
TRACEFILE = /tmp/myodbc-MyBillTracker.trc
TRACE = OFF
</h2>
=======================================
<h2>params in initmyodbc5.ora
# HS init parameters
HS_FDS_CONNECT_INFO = myodbc5
HS_FDS_TRACE_LEVEL = DEBUG
HS_FDS_SHAREABLE_NAME = /usr/local/lib/libodbc.so
HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
HS_FDS_SUPPORT_STATISTICS=FALSE
# ODBC specific environment variables
set ODBCINI=/usr/local/etc/odbc.ini
</h2>
===========================================
Oracle HS Trace file:
Oracle Corporation --- WEDNESDAY SEP 01 2010 16:11:19.060
Heterogeneous Agent Release
11.2.0.1.0
Oracle Corporation --- WEDNESDAY SEP 01 2010 16:11:19.059
Version 11.2.0.1.0
Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "DEBUG"
Entered hgosdip
setting HS_OPEN_CURSORS to default of 50
setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
setting HS_FDS_RECOVERY_PWD to default value
setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
setting HS_IDLE_TIMEOUT to default of 0
setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
setting HS_NLS_NCHAR to default of "AL32UTF8"
setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
setting HS_FDS_DATE_MAPPING to default of "DATE"
setting HS_RPC_FETCH_REBLOCKING to default of "ON"
setting HS_FDS_FETCH_ROWS to default of "100"
setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
setting HS_FDS_CHARACTER_SEMANTICS to default of "FALSE"
setting HS_FDS_MAP_NCHAR to default of "TRUE"
setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
setting HS_FDS_QUERY_DRIVER to default of "TRUE"
HOSGIP returned value of "FALSE" for HS_FDS_SUPPORT_STATISTICS
Parameter HS_FDS_QUOTE_IDENTIFIER is not set
setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
Default value of 64 assumed for HS_FDS_SQLLEN_INTERPRETATION
setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw
$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"
setting HS_FDS_DELAYED_OPEN to default of "TRUE"
setting HS_FDS_WORKAROUNDS to default of "0"
Exiting hgosdip, rc=0
ORACLE_SID is "myodbc5"
Product-Info:
Port Rls/Upd:1/0 PrdStat:0
Agent:Oracle Database Gateway for ODBC
Facility:hsa
Class:ODBC, ClassVsn:11.2.0.1.0_0008, Instance:myodbc5
Exiting hgogprd, rc=0
Entered hgoinit
HOCXU_COMP_CSET=1
HOCXU_DRV_CSET=31
HOCXU_DRV_NCHAR=873
HOCXU_DB_CSET=873
HOCXU_SEM_VER=112000
Entered hgolofn at 2010/09/01-16:11:19
HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/local/lib/libodbc.so"
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x159540
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1596f0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x159f20
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x15b230
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x163420
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x163880
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1661c0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1678f0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x168100
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x169c60
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x169c70
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16b3c0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16e640
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16ea00
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1705e0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1711d0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x171500
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1733a0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x173810
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x175870
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x175630
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x15bb50
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x15d4a0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x160e10
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x162cd0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x164400
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x167360
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x168a50
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x169fd0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16ba60
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16bfb0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16d2c0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16deb0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16f4a0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x16f760
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x170230
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x171cc0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1721e0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1727d0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x172e10
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x173ae0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x176ca0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1752b0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x1785b0
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Entered hgolofns at 2010/09/01-16:11:19
symbol_peflctx=0x179260
hoaerr:0
Exiting hgolofns at 2010/09/01-16:11:19
Exiting hgolofn, rc=0 at 2010/09/01-16:11:19
HOSGIP for "HS_OPEN_CURSORS" returned "50"
HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
Invalid value of 64 given for HS_FDS_SQLLEN_INTERPRETATION
treat_SQLLEN_as_compiled = 1
Exiting hgoinit, rc=0 at 2010/09/01-16:11:19
Entered hgolgon at 2010/09/01-16:11:19
reco:0, name:oracle, tflag:0
Entered hgosuec at 2010/09/01-16:11:19
Exiting hgosuec, rc=0 at 2010/09/01-16:11:19
HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_CHARACTER_SEMANTICS" returned "FALSE"
HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
using oracle as default value for "HS_FDS_DEFAULT_OWNER"
HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
Entered hgocont at 2010/09/01-16:11:19
HS_FDS_CONNECT_INFO = "myodbc5"
RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
Entered hgogenconstr at 2010/09/01-16:11:19
dsn:myodbc5, name:oracle
optn:
Entered hgocip at 2010/09/01-16:11:19
dsn:myodbc5
Exiting hgocip, rc=0 at 2010/09/01-16:11:19
Exiting hgogenconstr, rc=0 at 2010/09/01-16:11:19
Entered hgolosf at 2010/09/01-16:11:19
Exiting hgolosf, rc=0 at 2010/09/01-16:11:19
DriverName:libmyodbc5.so, DriverVer:05.01.0007
DBMS Name:MySQL, DBMS Version:5.0.67
Exiting hgocont, rc=0 at 2010/09/01-16:11:19
SQLGetInfo returns Y for SQL_CATALOG_NAME
SQLGetInfo returns 192 for SQL_MAX_CATALOG_NAME_LEN
Exiting hgolgon, rc=0 at 2010/09/01-16:11:19
Entered hgoulcp at 2010/09/01-16:11:19
Entered hgowlst at 2010/09/01-16:11:19
Exiting hgowlst, rc=0 at 2010/09/01-16:11:19
SQLGetInfo returns 0x0 for SQL_OWNER_USAGE
TXN Capable:3, Isolation Option:0xf
SQLGetInfo returns 0 for SQL_MAX_SCHEMA_NAME_LEN
SQLGetInfo returns 192 for SQL_MAX_TABLE_NAME_LEN
SQLGetInfo returns 192 for SQL_MAX_PROCEDURE_NAME_LEN
SQLGetInfo returns ` (0x60) for SQL_IDENTIFIER_QUOTE_CHAR
SQLGetInfo returns Y for SQL_COLUMN_ALIAS
4 instance capabilities will be uploaded
capno:1964, context:0x00000000, add-info: 0
capno:1989, context:0x00000000, add-info: 0
capno:1991, context:0x0001ffff, add-info: 0
capno:1992, context:0x0001ffff, add-info: 1, translation:"`"
Exiting hgoulcp, rc=0 at 2010/09/01-16:11:19
Entered hgouldt at 2010/09/01-16:11:19
NO instance DD translations were uploaded
Exiting hgouldt, rc=0 at 2010/09/01-16:11:19
Entered hgobegn at 2010/09/01-16:11:19
tflag:0 , initial:1
hoi:0x15d8f088, ttid (len 34) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C2E31 [GEMS.LSO.LOCAL.1]
10: 37373837 3164662E 31302E35 342E3533 [77871df.10.54.53]
20: 3938 [98]
tbid (len 31) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C5B31 [GEMS.LSO.LOCAL[1]
10: 302E3534 2E353339 385D5B31 2E345D [0.54.5398][1.4]]
Exiting hgobegn, rc=0 at 2010/09/01-16:11:19
Entered hgodtab at 2010/09/01-16:11:19
count:1
table: mbt_user
Allocate hoada[0] @ 0x7a6440
Entered hgopcda at 2010/09/01-16:11:19
Column:1(user_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
Entered hgopcda at 2010/09/01-16:11:19
Column:2(email): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:0, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
Entered hgopcda at 2010/09/01-16:11:19
Column:3(last_logged_in): dtype:93 (TIMESTAMP), prc/scl:19/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
Entered hgopcda at 2010/09/01-16:11:19
Column:4(mailing_list): dtype:-7 (BIT), prc/scl:1/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
Entered hgopcda at 2010/09/01-16:11:19
Column:5(password): dtype:-1 (LONGVARCHAR), prc/scl:65535/0, nullbl:0, octet:65535, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
The hoada for table mbt_user follows...
hgodtab, line 876: Printing hoada @ 0x7a6440
MAX:5, ACTUAL:5, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 0 0 0/ 0 0 0 220 password
Exiting hgodtab, rc=0 at 2010/09/01-16:11:19
Entered hgodafr, cursor id 0 at 2010/09/01-16:11:19
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/01-16:11:19
Entered hgopars, cursor id 1 at 2010/09/01-16:11:19
type:0
SQL text from hgopars, id=1, len=34 ...
00: 53454C45 43542043 4F554E54 282A2920 [SELECT COUNT(*) ]
10: 46524F4D 20606D62 745F7573 65726020 [FROM `mbt_user` ]
20: 4131 [A1]
Exiting hgopars, rc=0 at 2010/09/01-16:11:19
Entered hgoopen, cursor id 1 at 2010/09/01-16:11:19
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/01-16:11:19
Entered hgodscr, cursor id 1 at 2010/09/01-16:11:19
Allocate hoada @ 0x7a6440
Entered hgopcda at 2010/09/01-16:11:19
Column:1(COUNT(*)): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:0, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:19
hgodscr, line 880: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Exiting hgodscr, rc=0 at 2010/09/01-16:11:19
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:19
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/01-16:11:19
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:19
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/01-16:11:19
Entered hgoclse, cursor id 1 at 2010/09/01-16:11:26
Exiting hgoclse, rc=0 at 2010/09/01-16:11:26
Entered hgodafr, cursor id 1 at 2010/09/01-16:11:26
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/01-16:11:26
Entered hgopars, cursor id 1 at 2010/09/01-16:11:26
type:0
SQL text from hgopars, id=1, len=49 ...
00: 53454C45 43542041 312E6075 7365725F [SELECT A1.`user_]
10: 6964602C 41312E60 656D6169 6C602046 [id`,A1.`email` F]
20: 524F4D20 606D6274 5F757365 72602041 [ROM `mbt_user` A]
30: 31 [1]
Exiting hgopars, rc=0 at 2010/09/01-16:11:26
Entered hgoopen, cursor id 1 at 2010/09/01-16:11:26
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/01-16:11:26
Entered hgodscr, cursor id 1 at 2010/09/01-16:11:26
Allocate hoada @ 0x7a6440
Entered hgopcda at 2010/09/01-16:11:26
Column:1(user_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:26
Entered hgopcda at 2010/09/01-16:11:26
Column:2(email): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:0, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:26
hgodscr, line 880: Printing hoada @ 0x7a6440
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
Exiting hgodscr, rc=0 at 2010/09/01-16:11:26
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:26
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLBindCol: column 2, cdatatype: 1, bflsz: 256
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21, (bfl: 255, mbl: 255)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/01-16:11:26
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:26
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:2, ACTUAL:2, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 21 255 0/ 0 0 0 200 email
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/01-16:11:26
Entered hgoclse, cursor id 1 at 2010/09/01-16:11:39
Exiting hgoclse, rc=0 at 2010/09/01-16:11:39
Entered hgodafr, cursor id 1 at 2010/09/01-16:11:39
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/01-16:11:39
Entered hgopars, cursor id 1 at 2010/09/01-16:11:39
type:0
SQL text from hgopars, id=1, len=101 ...
00: 53454C45 43542041 312E6075 7365725F [SELECT A1.`user_]
10: 6964602C 41312E60 656D6169 6C602C41 [id`,A1.`email`,A]
20: 312E606C 6173745F 6C6F6767 65645F69 [1.`last_logged_i]
30: 6E602C41 312E606D 61696C69 6E675F6C [n`,A1.`mailing_l]
40: 69737460 2C41312E 60706173 73776F72 [ist`,A1.`passwor]
50: 64602046 524F4D20 606D6274 5F757365 [d` FROM `mbt_use]
60: 72602041 31 [r` A1]
Exiting hgopars, rc=0 at 2010/09/01-16:11:39
Entered hgoopen, cursor id 1 at 2010/09/01-16:11:39
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/01-16:11:39
Entered hgodscr, cursor id 1 at 2010/09/01-16:11:39
Allocate hoada @ 0x7a6440
Entered hgopcda at 2010/09/01-16:11:39
Column:1(user_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:39
Entered hgopcda at 2010/09/01-16:11:39
Column:2(email): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:0, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:39
Entered hgopcda at 2010/09/01-16:11:39
Column:3(last_logged_in): dtype:93 (TIMESTAMP), prc/scl:19/0, nullbl:1, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:39
Entered hgopcda at 2010/09/01-16:11:39
Column:4(mailing_list): dtype:-7 (BIT), prc/scl:1/0, nullbl:1, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:39
Entered hgopcda at 2010/09/01-16:11:39
Column:5(password): dtype:-1 (LONGVARCHAR), prc/scl:65535/0, nullbl:0, octet:65535, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/01-16:11:39
hgodscr, line 880: Printing hoada @ 0x7a6440
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 0 0 0/ 0 0 0 220 password
Exiting hgodscr, rc=0 at 2010/09/01-16:11:39
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:39
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 766 0 0/ 0 0 0 220 password
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLBindCol: column 2, cdatatype: 1, bflsz: 256
SQLBindCol: column 3, cdatatype: 93, bflsz: 16
SQLBindCol: column 4, cdatatype: -28, bflsz: 1
SQLBindCol: column 5, cdatatype: 1, bflsz: 767
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21, (bfl: 255, mbl: 255)
SQLFetch: row: 1, column 3, bflsz: 16, bflar: 16
SQLFetch: row: 1, column 3, bflsz: 16, bflar: 16, (bfl: 16, mbl: 16)
SQLFetch: row: 1, column 4, bflsz: 1, bflar: 1
SQLFetch: row: 1, column 4, bflsz: 1, bflar: 1, (bfl: 1, mbl: 1)
SQLFetch: row: 1, column 5, bflsz: 767, bflar: 40
SQLFetch: row: 1, column 5, bflsz: 767, bflar: 40, (bfl: 766, mbl: 0)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/01-16:11:39
Entered hgoftch, cursor id 1 at 2010/09/01-16:11:39
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 21 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 766 0 0/ 0 0 0 220 password
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/01-16:11:39
Entered hgoclse, cursor id 1 at 2010/09/01-16:11:45
Exiting hgoclse, rc=0 at 2010/09/01-16:11:45
Entered hgodafr, cursor id 1 at 2010/09/01-16:11:45
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/01-16:11:45
Entered hgocomm at 2010/09/01-16:11:45
keepinfo:0, tflag:1
00: 47454D53 2E4C534F 2E4C4F43 414C2E31 [GEMS.LSO.LOCAL.1]
10: 37373837 3164662E 31302E35 342E3533 [77871df.10.54.53]
20: 3938 [98]
tbid (len 31) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C5B31 [GEMS.LSO.LOCAL[1]
10: 302E3534 2E353339 385D5B31 2E345D [0.54.5398][1.4]]
cmt(0):
Entered hgocpctx at 2010/09/01-16:11:45
Exiting hgocpctx, rc=0 at 2010/09/01-16:11:45
Exiting hgocomm, rc=0 at 2010/09/01-16:11:45
Entered hgolgof at 2010/09/01-16:11:45
tflag:1
Exiting hgolgof, rc=0 at 2010/09/01-16:11:45
Entered hgoexit at 2010/09/01-16:11:45
Exiting hgoexit, rc=0<h2>This is the scenario where describe table only shows the first field during the first SQLPlus session. I closed the first SQLPlus session, simply opened a new SQLPlus session. Describe table shows all column definitions of MySQL table this time. You can see that there are three records in tracking_list table, however, select * from "tracking_list"@mybilltracker only retruns one record.</h2>
First SQLPlus Session:
SQL> describe "tracking_list"@mybilltracker;
Name Null? Type
list_id NUMBER(20)
SQL> select count(*) from "tracking_list"@mybilltracker;
COUNT(*)
3
SQL> select * from "tracking_list"@mybilltracker;
list_id
1
SQL> describe "tracking_list"@mybilltracker;
Name Null? Type
list_id NUMBER(20)
SQL> exit
========================================
Second SQLPlus Session:
Connected.
SQL> describe "tracking_list"@mybilltracker;
Name Null? Type
list_id NUMBER(20)
last_updt_date DATE
list_create_date DATE
list_name NOT NULL VARCHAR2(255)
list_yr NOT NULL NUMBER(10)
user_id NUMBER(20)
SQL> select count(*) from "tracking_list"@mybilltracker;
COUNT(*)
3
SQL> select * from "tracking_list"@mybilltracker;
list_id last_updt list_crea
list_name
list_yr user_id
1 02-SEP-10 02-SEP-10
List 1
2010 1
SQL> exit
=============================================
HS trace file for the first SQLPlus session:
Oracle Corporation --- THURSDAY SEP 02 2010 09:55:46.523
Heterogeneous Agent Release
11.2.0.1.0
Oracle Corporation --- THURSDAY SEP 02 2010 09:55:46.522
Version 11.2.0.1.0
Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "DEBUG"
Entered hgosdip
setting HS_OPEN_CURSORS to default of 50
setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
setting HS_FDS_RECOVERY_PWD to default value
setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
setting HS_IDLE_TIMEOUT to default of 0
setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
setting HS_NLS_NCHAR to default of "AL32UTF8"
setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
setting HS_FDS_DATE_MAPPING to default of "DATE"
setting HS_RPC_FETCH_REBLOCKING to default of "ON"
setting HS_FDS_FETCH_ROWS to default of "100"
setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
setting HS_FDS_CHARACTER_SEMANTICS to default of "FALSE"
setting HS_FDS_MAP_NCHAR to default of "TRUE"
setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
setting HS_FDS_QUERY_DRIVER to default of "TRUE"
HOSGIP returned value of "FALSE" for HS_FDS_SUPPORT_STATISTICS
Parameter HS_FDS_QUOTE_IDENTIFIER is not set
setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
Default value of 64 assumed for HS_FDS_SQLLEN_INTERPRETATION
setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"
setting HS_FDS_DELAYED_OPEN to default of "TRUE"
setting HS_FDS_WORKAROUNDS to default of "0"
Exiting hgosdip, rc=0
ORACLE_SID is "myodbc5"
Product-Info:
Port Rls/Upd:1/0 PrdStat:0
Agent:Oracle Database Gateway for ODBC
Facility:hsa
Class:ODBC, ClassVsn:11.2.0.1.0_0008, Instance:myodbc5
Exiting hgogprd, rc=0
Entered hgoinit
HOCXU_COMP_CSET=1
HOCXU_DRV_CSET=31
HOCXU_DRV_NCHAR=873
HOCXU_DB_CSET=873
HOCXU_SEM_VER=112000
Entered hgolofn at 2010/09/02-09:55:46
HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/local/lib/libodbc.so"
Entered hgolofns at 2010/09/02-09:55:46
symbol_peflctx=0xdc523540
hoaerr:0
Exiting hgolofns at 2010/09/02-09:55:46
......(repeating .....)
Entered hgolofns at 2010/09/02-09:55:46
symbol_peflctx=0xdc543260
hoaerr:0
Exiting hgolofns at 2010/09/02-09:55:46
Exiting hgolofn, rc=0 at 2010/09/02-09:55:46
HOSGIP for "HS_OPEN_CURSORS" returned "50"
HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
Invalid value of 64 given for HS_FDS_SQLLEN_INTERPRETATION
treat_SQLLEN_as_compiled = 1
Exiting hgoinit, rc=0 at 2010/09/02-09:55:46
Entered hgolgon at 2010/09/02-09:55:46
reco:0, name:oracle, tflag:0
Entered hgosuec at 2010/09/02-09:55:46
Exiting hgosuec, rc=0 at 2010/09/02-09:55:46
HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_CHARACTER_SEMANTICS" returned "FALSE"
HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
using oracle as default value for "HS_FDS_DEFAULT_OWNER"
HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
Entered hgocont at 2010/09/02-09:55:46
HS_FDS_CONNECT_INFO = "myodbc5"
RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
Entered hgogenconstr at 2010/09/02-09:55:46
dsn:myodbc5, name:oracle
optn:
Entered hgocip at 2010/09/02-09:55:46
dsn:myodbc5
Exiting hgocip, rc=0 at 2010/09/02-09:55:46
Exiting hgogenconstr, rc=0 at 2010/09/02-09:55:46
Entered hgolosf at 2010/09/02-09:55:46
Exiting hgolosf, rc=0 at 2010/09/02-09:55:46
DriverName:libmyodbc5.so, DriverVer:05.01.0007
DBMS Name:MySQL, DBMS Version:5.0.67
Exiting hgocont, rc=0 at 2010/09/02-09:55:46
SQLGetInfo returns Y for SQL_CATALOG_NAME
SQLGetInfo returns 192 for SQL_MAX_CATALOG_NAME_LEN
Exiting hgolgon, rc=0 at 2010/09/02-09:55:46
Entered hgoulcp at 2010/09/02-09:55:46
Entered hgowlst at 2010/09/02-09:55:46
Exiting hgowlst, rc=0 at 2010/09/02-09:55:46
SQLGetInfo returns 0x0 for SQL_OWNER_USAGE
TXN Capable:3, Isolation Option:0xf
SQLGetInfo returns 0 for SQL_MAX_SCHEMA_NAME_LEN
SQLGetInfo returns 192 for SQL_MAX_TABLE_NAME_LEN
SQLGetInfo returns 192 for SQL_MAX_PROCEDURE_NAME_LEN
SQLGetInfo returns ` (0x60) for SQL_IDENTIFIER_QUOTE_CHAR
SQLGetInfo returns Y for SQL_COLUMN_ALIAS
4 instance capabilities will be uploaded
capno:1964, context:0x00000000, add-info: 0
capno:1989, context:0x00000000, add-info: 0
capno:1991, context:0x0001ffff, add-info: 0
capno:1992, context:0x0001ffff, add-info: 1, translation:"`"
Exiting hgoulcp, rc=0 at 2010/09/02-09:55:46
Entered hgouldt at 2010/09/02-09:55:46
NO instance DD translations were uploaded
Exiting hgouldt, rc=0 at 2010/09/02-09:55:46
Entered hgobegn at 2010/09/02-09:55:46
tflag:0 , initial:1
hoi:0x8b4b52f8, ttid (len 34) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C2E31 [GEMS.LSO.LOCAL.1]
10: 37373837 3164662E 33322E36 382E3335 [77871df.32.68.35]
20: 3630 [60]
tbid (len 31) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C5B33 [GEMS.LSO.LOCAL[3]
10: 322E3638 2E333536 305D5B31 2E345D [2.68.3560][1.4]]
Exiting hgobegn, rc=0 at 2010/09/02-09:55:46
Entered hgodtab at 2010/09/02-09:55:46
count:1
table: mbt_user
Allocate hoada[0] @ 0x7a6440
Entered hgopcda at 2010/09/02-09:55:46
Column:1(user_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-09:55:46
Entered hgopcda at 2010/09/02-09:55:46
Column:2(email): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:0, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-09:55:46
Entered hgopcda at 2010/09/02-09:55:46
Column:3(last_logged_in): dtype:93 (TIMESTAMP), prc/scl:19/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-09:55:46
Entered hgopcda at 2010/09/02-09:55:46
Column:4(mailing_list): dtype:-7 (BIT), prc/scl:1/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-09:55:46
Entered hgopcda at 2010/09/02-09:55:46
Column:5(password): dtype:-1 (LONGVARCHAR), prc/scl:65535/0, nullbl:0, octet:65535, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-09:55:46
The hoada for table mbt_user follows...
hgodtab, line 876: Printing hoada @ 0x7a6440
MAX:5, ACTUAL:5, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 0 0 0/ 0 0 0 220 password
Exiting hgodtab, rc=0 at 2010/09/02-09:55:46
Entered hgodafr, cursor id 0 at 2010/09/02-09:55:46
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/02-09:55:46
Entered hgopars, cursor id 1 at 2010/09/02-09:55:52
type:0
SQL text from hgopars, id=1, len=101 ...
00: 53454C45 43542041 312E6075 7365725F [SELECT A1.`user_]
10: 6964602C 41312E60 656D6169 6C602C41 [id`,A1.`email`,A]
20: 312E606C 6173745F 6C6F6767 65645F69 [1.`last_logged_i]
30: 6E602C41 312E606D 61696C69 6E675F6C [n`,A1.`mailing_l]
40: 69737460 2C41312E 60706173 73776F72 [ist`,A1.`passwor]
50: 64602046 524F4D20 606D6274 5F757365 [d` FROM `mbt_use]
60: 72602041 31 [r` A1]
Exiting hgopars, rc=0 at 2010/09/02-09:55:52
Entered hgoopen, cursor id 1 at 2010/09/02-09:55:52
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/02-09:55:52
Entered hgodscr, cursor id 1 at 2010/09/02-09:55:52
Allocate hoada @ 0x7a63a0
Entered hgopcda at 2010/09/02-09:55:52
Column:1(user_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:55:52
Entered hgopcda at 2010/09/02-09:55:52
Column:2(email): dtype:12 (VARCHAR), prc/scl:255/0, nullbl:0, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:55:52
Entered hgopcda at 2010/09/02-09:55:52
Column:3(last_logged_in): dtype:93 (TIMESTAMP), prc/scl:19/0, nullbl:1, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:55:52
Entered hgopcda at 2010/09/02-09:55:52
Column:4(mailing_list): dtype:-7 (BIT), prc/scl:1/0, nullbl:1, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:55:52
Entered hgopcda at 2010/09/02-09:55:52
Column:5(password): dtype:-1 (LONGVARCHAR), prc/scl:65535/0, nullbl:0, octet:65535, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:55:52
hgodscr, line 880: Printing hoada @ 0x7a63a0
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 0 0 0/ 0 0 0 220 password
Exiting hgodscr, rc=0 at 2010/09/02-09:55:52
Entered hgoftch, cursor id 1 at 2010/09/02-09:55:52
hgoftch, line 130: Printing hoada @ 0x7a63a0
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 255 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 766 0 0/ 0 0 0 220 password
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLBindCol: column 2, cdatatype: 1, bflsz: 256
SQLBindCol: column 3, cdatatype: 93, bflsz: 16
SQLBindCol: column 4, cdatatype: -28, bflsz: 1
SQLBindCol: column 5, cdatatype: 1, bflsz: 767
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21
SQLFetch: row: 1, column 2, bflsz: 256, bflar: 21, (bfl: 255, mbl: 255)
SQLFetch: row: 1, column 3, bflsz: 16, bflar: 16
SQLFetch: row: 1, column 3, bflsz: 16, bflar: 16, (bfl: 16, mbl: 16)
SQLFetch: row: 1, column 4, bflsz: 1, bflar: 1
SQLFetch: row: 1, column 4, bflsz: 1, bflar: 1, (bfl: 1, mbl: 1)
SQLFetch: row: 1, column 5, bflsz: 767, bflar: 40
SQLFetch: row: 1, column 5, bflsz: 767, bflar: 40, (bfl: 766, mbl: 0)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/02-09:55:52
Entered hgoftch, cursor id 1 at 2010/09/02-09:55:52
hgoftch, line 130: Printing hoada @ 0x7a63a0
MAX:5, ACTUAL:5, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY,0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 user_id
12 VARCHAR N 21 255 0/ 0 0 0 200 email
91 DATE Y 16 16 0/ 0 0 0 0 last_logged_in
-7 BIT Y 1 1 0/ 0 0 0 20 mailing_list
-1 LONGVARCHAR N 766 0 0/ 0 0 0 220 password
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/02-09:55:52
Entered hgoclse, cursor id 1 at 2010/09/02-09:56:16
Exiting hgoclse, rc=0 at 2010/09/02-09:56:16
Entered hgodafr, cursor id 1 at 2010/09/02-09:56:16
Free hoada @ 0x7a63a0
Exiting hgodafr, rc=0 at 2010/09/02-09:56:16
Entered hgopars, cursor id 1 at 2010/09/02-09:56:16
type:0
SQL text from hgopars, id=1, len=34 ...
00: 53454C45 43542043 4F554E54 282A2920 [SELECT COUNT(*) ]
10: 46524F4D 20606D62 745F7573 65726020 [FROM `mbt_user` ]
20: 4131 [A1]
Exiting hgopars, rc=0 at 2010/09/02-09:56:16
Entered hgoopen, cursor id 1 at 2010/09/02-09:56:16
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/02-09:56:16
Entered hgodscr, cursor id 1 at 2010/09/02-09:56:16
Allocate hoada @ 0x7a63a0
Entered hgopcda at 2010/09/02-09:56:16
Column:1(COUNT(*)): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:0, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-09:56:16
hgodscr, line 880: Printing hoada @ 0x7a63a0
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Exiting hgodscr, rc=0 at 2010/09/02-09:56:16
Entered hgoftch, cursor id 1 at 2010/09/02-09:56:16
hgoftch, line 130: Printing hoada @ 0x7a63a0
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/02-09:56:16
Entered hgoftch, cursor id 1 at 2010/09/02-09:56:16
hgoftch, line 130: Printing hoada @ 0x7a63a0
MAX:1, ACTUAL:1, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/02-09:56:16
Entered hgodtab at 2010/09/02-10:03:18
count:1
table: tracking_list
Allocate hoada[0] @ 0x7ebbd0
Entered hgopcda at 2010/09/02-10:03:18
Column:1(list_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:10
Exiting hgopcda, rc=0 at 2010/09/02-10:03:18
The hoada for table tracking_list follows...
hgodtab, line 876: Printing hoada @ 0x7ebbd0
MAX:1, ACTUAL:1, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 list_id
Exiting hgodtab, rc=0 at 2010/09/02-10:03:18
Entered hgodafr, cursor id 0 at 2010/09/02-10:03:18
Free hoada @ 0x7ebbd0
Exiting hgodafr, rc=0 at 2010/09/02-10:03:18
Entered hgoclse, cursor id 1 at 2010/09/02-10:06:11
Exiting hgoclse, rc=0 at 2010/09/02-10:06:11
Entered hgodafr, cursor id 1 at 2010/09/02-10:06:11
Free hoada @ 0x7a63a0
Exiting hgodafr, rc=0 at 2010/09/02-10:06:11
Entered hgopars, cursor id 1 at 2010/09/02-10:06:11
type:0
SQL text from hgopars, id=1, len=39 ...
00: 53454C45 43542043 4F554E54 282A2920 [SELECT COUNT(*) ]
10: 46524F4D 20607472 61636B69 6E675F6C [FROM `tracking_l]
20: 69737460 204131 [ist` A1]
Exiting hgopars, rc=0 at 2010/09/02-10:06:11
Entered hgoopen, cursor id 1 at 2010/09/02-10:06:11
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/02-10:06:11
Entered hgodscr, cursor id 1 at 2010/09/02-10:06:11
Allocate hoada @ 0x7a63e8
Entered hgopcda at 2010/09/02-10:06:11
Column:1(COUNT(*)): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:0, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-10:06:11
hgodscr, line 880: Printing hoada @ 0x7a63e8
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Exiting hgodscr, rc=0 at 2010/09/02-10:06:11
Entered hgoftch, cursor id 1 at 2010/09/02-10:06:11
hgoftch, line 130: Printing hoada @ 0x7a63e8
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/02-10:06:11
Entered hgoftch, cursor id 1 at 2010/09/02-10:06:11
hgoftch, line 130: Printing hoada @ 0x7a63e8
MAX:1, ACTUAL:1, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT N 8 8 0/ 0 0 0 20 COUNT(*)
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/02-10:06:11
Entered hgoclse, cursor id 1 at 2010/09/02-10:06:20
Exiting hgoclse, rc=0 at 2010/09/02-10:06:20
Entered hgodafr, cursor id 1 at 2010/09/02-10:06:20
Free hoada @ 0x7a63e8
Exiting hgodafr, rc=0 at 2010/09/02-10:06:20
Entered hgopars, cursor id 1 at 2010/09/02-10:06:20
type:0
SQL text from hgopars, id=1, len=43 ...
00: 53454C45 43542041 312E606C 6973745F [SELECT A1.`list_]
10: 69646020 46524F4D 20607472 61636B69 [id` FROM `tracki]
20: 6E675F6C 69737460 204131 [ng_list` A1]
Exiting hgopars, rc=0 at 2010/09/02-10:06:20
Entered hgoopen, cursor id 1 at 2010/09/02-10:06:20
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2010/09/02-10:06:20
Entered hgodscr, cursor id 1 at 2010/09/02-10:06:20
Allocate hoada @ 0x7a6440
Entered hgopcda at 2010/09/02-10:06:20
Column:1(list_id): dtype:-5 (BIGINT), prc/scl:19/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2010/09/02-10:06:20
hgodscr, line 880: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 list_id
Exiting hgodscr, rc=0 at 2010/09/02-10:06:20
Entered hgoftch, cursor id 1 at 2010/09/02-10:06:20
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 list_id
Performing delayed open.
SQLBindCol: column 1, cdatatype: -25, bflsz: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8
SQLFetch: row: 1, column 1, bflsz: 8, bflar: 8, (bfl: 8, mbl: 8)
1 rows fetched
Exiting hgoftch, rc=0 at 2010/09/02-10:06:20
Entered hgoftch, cursor id 1 at 2010/09/02-10:06:20
hgoftch, line 130: Printing hoada @ 0x7a6440
MAX:1, ACTUAL:1, BRC:1, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x20:NEGATIVE_HOADADTY)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
-5 BIGINT Y 8 8 0/ 0 0 0 20 list_id
0 rows fetched
Exiting hgoftch, rc=1403 at 2010/09/02-10:06:20
Entered hgoclse, cursor id 1 at 2010/09/02-10:06:55
Exiting hgoclse, rc=0 at 2010/09/02-10:06:55
Entered hgodafr, cursor id 1 at 2010/09/02-10:06:55
Free hoada @ 0x7a6440
Exiting hgodafr, rc=0 at 2010/09/02-10:06:55
Entered hgocomm at 2010/09/02-10:06:55
keepinfo:0, tflag:1
00: 47454D53 2E4C534F 2E4C4F43 414C2E31 [GEMS.LSO.LOCAL.1]
10: 37373837 3164662E 33322E36 382E3335 [77871df.32.68.35]
20: 3630 [60]
tbid (len 31) is ...
00: 47454D53 2E4C534F 2E4C4F43 414C5B33 [GEMS.LSO.LOCAL[3]
10: 322E3638 2E333536 305D5B31 2E345D [2.68.3560][1.4]]
cmt(0):
Entered hgocpctx at 2010/09/02-10:06:55
Exiting hgocpctx, rc=0 at 2010/09/02-10:06:55
Exiting hgocomm, rc=0 at 2010/09/02-10:06:55
Entered hgolgof at 2010/09/02-10:06:55
tflag:1
Exiting hgolgof, rc=0 at 2010/09/02-10:06:55
Entered hgoexit at 2010/09/02-10:06:55
Exiting hgoexit, rc=0
Maybe you are looking for
-
Concept Construct a traffic flow simulator that models cars travelling down a laneway. You may create the simulator in several stages, each one more sophisticated than the previous. In the last stage, cars travel along the laneway at various speeds,
-
Intermittent wireless with Vista
Hi Just wondering if anyone can help me please? Just installed BT Home hub 2.0 and I can pick up the wireless with no problems on my 1 laptop with XP but no such luck on the other laptop with Vista. If our Sky is switched off at the wall it works bu
-
How can I scan my network to determine which PC is using static IP or DHCP?
Hello friends, I`m using Spiceworks for couple of days alreadyand need some help on this - In another post i saw that via SpiceWorks I can see how many PCs are using DHCP or Static IP (http://community.spiceworks.com/topic/37663-how-can-i-scan-my-net
-
Animated tab box - playReverse when click elsewhere?
Hello! I've got a bit of a tricky one I'm hoping someone could help me with! I've designed what is basically a tabbed info window in Edge Animate to add to a website deigned in Muse. There are 5 animated headings and when each one is clicked, the re
-
Copying value of objects, not reference?
This has been bothering me for a while. I learned that when you set one object equal to another you are really just assigning the same reference to both, so that if one is altered they are both altered. Well, how can you set one object equal to the v