Deploy Applet and MySQL - how to read and write

Question on deploying Applet and MySQL
I am building an applet that is to be a part of a simple game. The applet is supposed to read data from a MySQL server and use it to place towns on the map. In addition, the applet must be able to write to the base.
I have build a prototype and ran it in netbeans on my computer. It then successfully read data from a local MySQL base. HOWEVER; when I embed the applet in html code it no longer reads from the base. My method for connecting to the base is
try{
Statement stmt;
ResultSet rs;
Class.forName("com.mysql.jdbc.Driver");
String url=adress;
Connection con=DriverManager.getConnection(url, user, user);
stmt=con.createStatement();
rs=stmt.executeQuery("SELECT * " +
"from "+table+" ORDER BY id");
while(rs.next()){
get data...
Town T=new Town(data...); //construct town object
TL.put(T); //put town objects in an object TownList to use later
con.close();
catch(Exception e){
So;
1) Why wont the applet read anymore?
2) Is there a better way to do this? I have heard that its better to connect applets to servlets in some situations. What demands does this place on the server? Is there software that you need to install on the server to use servlets?

I think I do need an applet. The map I have written permits a lot of features that I dont know how to achieve in another way.
1) Zooming in and out on mousewheel
2) Clicking on on two towns gives the distance and by selecting a trooptype one can get information about the traveltime between cities.
3) Right now, I have a feature to find players or groups of players that are of special interest. It allows a player to submit a list of interesting players. The applet reads this list and provides a button with the players name. If one clicks the name of a player, all his cities flash between their originall color and white (using thread).
I need java to do this and I need to run it in a webbrowser because there are som parts of the game that is made up of php. So I assume I have to build it as an applet?

Similar Messages

  • How to read or write cookies within Applets?

    To make a session between an Applet and a Servlets I want to read and write cookies with an Applet.
    Does anyone know if an Applet is allowed to read and write cookies? And how to make it?

    All you have to do is type cookies in the search box and click search and you'll find topics such as the one posted below:
    http://java.sun.com/j2se/1.4/docs/guide/plugin/developer_guide/cookie_support.html
    V.V.

  • How To Read/Modify/Write Array?

    Ive got a bunch of switches, where each switch represents a bit in a
    word...
    So from each switch, in the control panel, it goes throu a boolean to
    integer vi, and then to a x*2^n vi.
    I then set a constant for each n.. so that if the switch is true (x=1
    after the conversion) and n = 5 for that switch,
    then the output will be 1 * 2^5.
    Finally, I add all 16 outputs together (x*2^0 to x*2^15) to create a
    word.. I actually have so many switches
    that I have a couple of words (each made up with the above scheme)!
    So far, this works fine, however, my question is, I would like to have
    a global array that contains these words. I
    dont want to insert this word into the array, but rather, I'd like to
    sort of latch the values...
    If in the array's word, the n bit was already one (i.e. that switch at
    one point was on), then I dont want to reset it
    to 0, even though the switch is off now.
    This probably sounds confusing, I know I am confused just reading that
    back, anyhoot, if I could make a global
    array (ten 16-bit unsigned words), that I can read any word from,
    modify it and set it back to its same place,
    that would be great!

    Hi Anonoymous
    Here's one quick example that does what you want, it functions like a function global and relies on boolean logic.
    For your own experience I challenge you how to reset just one bit or word.
    Also you have to connect the connector pane.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    quickbitregister.vi ‏20 KB

  • How to read and write to file on server

    can any body tell how to read or write to a file on server, like where do i keep the file and what does the path look like......on server
    stand alone i am reading and writing into file but when it comes to server i am confused how it works...i mean the path
    thank you

    The Path needs to be absolute:
    For example in Unix it would look like:
    /usr/paz/Test.txtIn Windows it would look like:
    C:/Paz/Test.txtHope this helps.
    Thanks and regards,
    Pazhanikanthan. P

  • How to read data in Chunks ?

    Hi Experts,
    I am in a situation like I am reading data from DataBase. It returns around 600 records against one call. How can I handle it like read first 200 records first then other 200 and similarly last 200 records.
    Any way or best technique ?
    Thanks

    Hi,
    First Determine the Chunk Count with chunk size parameter.let say for ur case u have 600 records in a call then define chunk.size=200 so tat run 3 times .
    if ur using jdev 10g then define chunk .size paramter in the deployment descriptor and write logic for the first chunk first row num=1 to last rownum=200 and in the second chunk first rornum=201 and last rownum=400 ,3rd chunk first rownum=401 to lst rownum =600.

  • How do I automatically write-to-file the text from an applet?

    I'm trying to generate a file containing the text information that I'm getting off a webpage. The information, however, is in the form of an applet that displays the words on my browser. How do I automatically read the info in an applet and write it to a file?

    Is the inforamtion written inside some swing component?
    If yes, then you can read the content of that swing component, after that writing what you have read to a file is easy.

  • Read or Write registry

    hi,
    anybody know apex how to read or write registry ?
    thanks.

    Hello,
    >> Is this can used on IE ?
    If you can access a specific Microsoft resource like the registry, using FF, it’s only make sense that you’ll be able to do it using IE. In any case, the XPCOM object, which deals with the registry manipulation, is a cross platform component object model, so it should work for IE also.
    >> cause i not so familiar on JavaScript
    It’s a good time to start. Regardless of your registry problem, if you are serious about using APEX, or any other web development for that matter, JavaScript is something you need to master.
    Personally, I’m not keen on allowing my browser to poke around my machine registry. Can you give us some more details on what you are trying to achieve? Maybe someone will come with a better (and safer) way of doing what you need.
    Regards,
    Arie.

  • How can i deploy macbooks and 802.1x authentication using PEAP/MSChap version 2

    How can i deploy macbooks and 802.1x authentication for wireless connectivity using PEAP/MSChap version 2. The Cert is generated by a 2008 Windows CA authority. I am trying to get to join but the MAC doesnt seem to want to accecpt the cert. Can i not validate the cert and still have it join the 802.1x wireless netqwotk? The wireless netwotk is using a Cisco 5508 wireless controller and Cisco 1142 access points. All works fine with Windows devices.

    Hi Tarik,
    Thanks for your answers,
    I've attached my configured AuthZ rules and AuthZ profile for provisioning,
    I want the process to be the same for iPhone, Android and Windows.
    1) Connect to the SSID
    2) Login using your AD credentials PEAP-MS-CHAP-v2
    3) Redirect to device registration portal (So I can set a limit of 3 devices per employee)
    4) As soon as the client click "register" no more redirects and PERMIT-ALL
    I think that I don't need to rely on profiling because In terms of AuthZ policies it should be something like this:
    1) if WIRELESS802.1x and PEAP-MS-CHAPV2 and BYODREGISTRATION=!YES(Unknown or not reg) then "Redirect to device registration(that is NSP right?)"
    2) if WIRELESS802.1x and PEAP-MS-CHAPV2 then PERMIT-ALL(no redirection)
    3) everything else = DENY-ALL
    But the NSP looks for Client Provisioning policies, so if I don't configure any policy it should Allow Network Access(See attachment photo3.png) but as I said on the post it shows that cannot retrieve the MAC-Address so the client can't register his device and don't have access to the network. (To grant access I've configured provisioning policies, that way the clients can register their devices but they are redirected to google play or are forced to install the profile at iOS and this is what I don't want because it is not necessary)
    What screenshoot do you need after the registration? the Auth report?
    Thank you very much for your time!

  • How to create signed applet and make it work with browser

    i hav an applet that needs to write a file to onto local system resource. i came to know that the applet needs to be signed. so i searched some guides to create a signed applet but most of them specify how to use it with applet viewer and not on a browser. plz help me with how to sign an applet and and allow it to write a file from within a browser.

    On linux, something like this:
    keytool -genkey -alias signSocket -keystore socketstore -keypass abc123 -dname "cn=your name" -storepass abc123
    jar cvf Socket.jar *.class
    jarsigner -keystore socketstore -storepass abc123 -keypass abc123 -signedjar SSocket.jar Socket.jar signSocket
    And in html:
    CODE = "YourClass.class"
    ARCHIVE = "SSocket.jar"
    ...

  • HT1420 I'm deployed overseas and my iTunes account will not let me buy music how do i fix this problem

    I'm deployed overseas and my iTunes account will not let me buy music how do i fix this problem

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Select "/var/log/install.log" from the file list on the left. If you don't see that list, select
    View ▹ Show Log List
    from the menu bar. Then select the messages from the last installation or update attempt, starting from the time when you initiated it. If you're not sure when that was, start over and note the time. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    If there are runs of repeated messages, post only one example of each. Don’t post many repetitions of the same message.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Edit it out by search-and-replace in a text editor before posting.

  • How to read excel file in document library and store excel content in sql table

    Hello,
    Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
    Please let me know the ways to acheive this. Feel free to give your suggestions.
    Thanks,
    Cool Developer

    Hi!
    this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
    System.Data.OleDb.
    OleDbConnection ExcelConnection = null;
    FileMode fileMode;
    string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
    using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
    using (SPWeb _web = _site.OpenWeb())
    string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
    SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
    fileMode =
    FileMode.Create;
    byte[] byteArray = _file.OpenBinary();
    MemoryStream dataStream = new MemoryStream(byteArray);
    Stream stream = dataStream;
    using (FileStream fs = File.Open(filePath, fileMode))
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
    fs.Write(buffer, 0, bytesRead);
    fs.Close();
    //Create the Connection String
    try
    string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source ='"
    + filePath + "'; Extended Properties=Excel 5.0";
    //Create the connection
    ExcelConnection =
    new System.Data.OleDb.OleDbConnection(ConnectionString);
    //create a string for the query
    string ExcelQuery;
    //Sheet1 is the sheet name
    //create the query:
    //read columns from the Excel file
    ExcelQuery =
    "Select * from [Sheet1$]"; // from Sheet1";
    //use "Select * ... " to select the entire sheet
    //create the command
    System.Data.OleDb.
    OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
    //Open the connection
    ExcelConnection.Open();
    //Create a reader
    System.Data.OleDb.
    OleDbDataReader ExcelReader;
    ExcelReader = ExcelCommand.ExecuteReader();
    //For each row after the first
    while (ExcelReader.Read())
    thanks,
    kshitij

  • What is S.M.A.R.T. and how to read S.M.A.R.T. attributes

    Read the bottom for updated information/amendments
    Hi everyone,
    S.M.A.R.T. is Self-Monitoring, Analysis and Reporting Technology.
    [size=15]1. S.M.A.R.T. info websites[/size]
    OK, now we all know what S.M.A.R.T. stands for. For more details about S.M.A.R.T., here is a comprehensive non-technical explanation about S.M.A.R.T. by pcguide.com. Maxtor has published a white paper on S.M.A.R.T. too. And this is from Seagate. Anyhow, I am not going to discuss whether S.M.A.R.T will protect your harddisk from failure, etc etc here. Let us focus more on S.M.A.R.T. itself.
    [size=15]2. S.M.A.R.T. monitoring tools[/size]
    S.M.A.R.T. data is stored as a tabulated data somewhere in the harddisk as registers. The tools below support reading these registers value from S.M.A.R.T. enabled harddisk.
    1. SpeedFan *sign-up is required for download, but it's FREE
    2. Active SMART
    3. Sisoftware SANDRA 2002.6.8.97 SP1 , older version doesn't support
    [size=15]3. S.M.A.R.T. Tabulated Information[/size]
    Here is a screenshot captured with SpeedFan.
    Let us go through the screenshot. As can be seen, there are 5 columns - Attribute, Value, Worst, Warn and Raw.
    Attribute
    describes the meaning of the values. As mentioned above, the SMART data is stored as a tabulated data as registers. Each attribute represents one register ID. eg Raw Read Error Rate is register ID 01, register ID 03 is Spin-up Time, etc.
    Note that the register IDs are not displayed by SpeedFan, but are displayed by other SANDRA and Active SMART. I have no idea how many S.M.A.R.T. attributes are there, Active SMART stated it can detect more than 35 attributes!
    However, some attributes are manufacturer specific. So possibly some attribute names as shown in these SMART tools might not represent the true meaning of the values too!!
    Value
    is the current relative value of the attribute read from the registers.
    Worst
    is the worst value ever achieved.
    Warn
    is the critical threshold value of the attribute. If the Value has reached and OVER this threshold value, with very high probability the harddisk is in trouble. If SMART is enabled in the BIOS, SMART will alert user in the POST screen, with some manufacturer specific error code. You may need to refer to your manufacturer then.
    Note : Value, Worst and Warn are all relative values, such as percentage, not actual count. I have no idea how to calculate these values. This is the very S.M.A.R.T. algorithm, isn't it? ?(
    Raw
    is in fact, the most understandable represented value here! It represents the actual count of the attribute. SpeedFan displays this raw value as hexadecimal numbers. Such as Power On Hours Count is "AA8", which is 2728 in decimal numbers, meaning that the harddisk has been power on for 2728 hours!! There are some Raws represent average rate, such as "CRC Error Rate" etc.
    [size=15]4. S.M.A.R.T. Attributes In Detail[/size]
    Hopefully by now, you have the basic idea how to read the tabulated data. I will try my best to go through the attributes one-by-one, which after that shall make you understand more about S.M.A.R.T. and of course, starts to appreciate it.
    Raw Read Error Rate represents the condition of the physical disk, based on raw (physical) read errors, and physical surface defects.
    Spin Up Time is the time taken for the hdd to spin-up. more info
    Start/Stop Count is the number of counts (cycles) the hdd start/stop. more info
    Reallocated Sector Count - the number of sectors have been reallocated. Surface scan and found bad sector will increase this count. Now this drive has 7 bad sectors already!
    Seek Error Rate - how often the drive failed to locate the data (seeking)
    Power On Hours Count - the number of hours you have powered on the HDD.
    Spin Retry Count - how many time your drive need to attempt to get the drive platter spinning. If this value is more than 1, your drive is seriously in very bad condition!
    Calibration Retry Count - represents the number of time your drive perform calibration retry. I am not sure if low-level format would increase this value.
    Power Cycle CountThe number of time the hdd has been powered on. On and Off = 1 cycle.
    Read Soft Error Rate - should be Soft Read Error Rate. Similar to Raw Read Error Rate but this one depends on logical level, such as error occured in the hdd buffer, etc.
    Temperature - The drive temperature, Forget the relative values, read from the Raw value -- "2D" in this example, which is 45C. But my SpeedFan displayed 47C at that time!! SpeedFan seems to produce some +-2C error from actual reading once in a while. :P
    Hardware ECC Recovered is the number of counts ECC correction is performed on the data.
    Reallocated Event Count - similar to Reallocated Sector Count but this one is on the data.
    Current Pending Sector - is the number of counts how many sectors are currently pending. But what is a pending sector?? ?( ?(
    Offline Correctable - which is Off-line Scan Uncorrectable Sector Count. Again, what is off-line scan?
    UltraATA CRC Error Rate - which is in fact, CRC Error Count instead of rate. As shown, there have been "3C3", which is 883 errors occured already!!!
    There are more S.M.A.R.T. attributes, such as
    Thoroughput Performance - again, this relative value is surely got from some wierd algorithm again.
    Seek Time Performance - some algorithm has been used to calculate this performance value.
    Power Off Retract and Load Cycle Count are IBM HDD specific features -- unload the head off the platters when power off. More info on Head Load/unload cycle.
    [size=15]5. SpeedFan S.M.A.R.T. Fitness and Performance bars[/size]
    I should not comment on this too much because this is Almico's work. I am not sure how he calculate to define the "fitness" and "performance" though. It could probably based on mathematic relation between the current Values  and the threshold Warns.  
    For most hdds, like Maxtor and Seagate's, out-of-the-box the fitness bar has already reaching half-way 50%. But for IBM hdd, the fitness bar is always around 100%. This is because IBM hdd has its threshold/Warn values set to unrealistically high until it's quite unreachable even after a long term use. While for other brand HDDs, the threshold values are more realistic. Thus, the fitness bar in particular, does not tell the true fitness of the HDD. Take it as a reference only. Please always refer back to the Raw values to determine the fitness.
    [size=15]6. Conclusion : Judging HDD fitness by our own selves![/size]
    Now we all know what the Attributes are, so roughly everyone will have the basic idea how to judge HDD health by our own selves depend on the attributes you're reading. S.M.A.R.T. itself however, define "fitness" and "performance" based on its own algorithm.
    We can categorize the attributes into :
    Error Related Attributes
    "UltraATA CRC Error Rate", "Raw Read Error Rate", "Raw Soft Error Rate", "Hardware ECC Recovered Count", "Reallocated Sector Count", "Reallocated Event/Data Count", Offline Correctable"
    -- tell how often are those errors occured. For the above example, this Maxtor harddisk should be RMA-ed for its high CRC Error Rate count.
    Drive Fitness Attributes
    Spin Up Time, Start/Stop Count, Seek Error Rate, Power On Hours Count, Spin Retry Count, Calibration Retry Count, Power Cycle Count, Power Off Retract Count, Load Cycle Count
    -- check "spin retry count" and "Seek Error Rate", any value other than zero is really bad.
    Other Attributes
    I have no idea what they are for except Temperature.
    As the conclusion, understanding S.M.A.R.T. attributes helps in knowing your HDD fitness by your own self, rather than waiting for the S.M.A.R.T. to alert you for severe error. That might be too late already.  8o
    Thanks for reading.
    Edited:
    1. for better reading pleasure
    2. added Conclusion
    3. added explanations about SpeedFan SMART Fitness and Performance bar.

    Quote
    Originally posted by WarLord
    I like this HD tool. i use it everyday now. the tempture readings are great Hd temp cpu temp and even the system temp nice added feature to the monitoring. And this is an alternative to enabling the SMART in the bios? Thats the way im understanding it. is that right Maesus ?Because i have disabled in bios. She went threw alot of trouble here. thank you  
    Well from my observation, whether SMART is disabled or enabled in the BIOS, SMART is always working within the HDD itself.
    Basically SMART is acting like a blackbox, monitoring and tabulating HDD condition from time to time and its attributes only fully revealable by the manufacturers. SpeedFan's SMART status only displays partial information that is displayable. Some attributes are hidden, ~OR~ the attributes' locations are different from one HDD to another brand, such that some values don't correspond to the attribute meaning at all.
    It is very doubtful to claim that enabling SMART in the BIOS will hog down the performance. Just like a transport bus (yeah real bus that fetch passenger :P ), with or without the black box installed can't help it if the driver wants to speeding. :P

  • How can i store a value in a register, to be called up later in the program. I must be able to read and write to it.

    Im looking at a bearing reading and i only want it to do a case loop if the data has changed on the bearing, so i need a value of what it was a cycle ago to compare it with, how do i do this?

    Hi,
    I'm not sure I,ve understood you clearly but it looks like you need to use "shift registers" in the loop.
    Shift registers allow you to pass data from one iteration of the loop to another. For example in the situation when you need to know the value of some variable on previous iteration or on pre-previous etc.
    To create shift registers on the loop you have to right click on the border of the loop and select "Add shift register" from pop up menu. Two arrows will appear on the left and right sides of the loop. To write data to the shift register you have to wire them to the right arrow, and to read data you have to read it from the left arrow. When you read data from shift register you read the value from the previous iteration. When you write data - you wri
    te the curent value there. If you want to read preprevious data you have to click on the left side of shift register and select "Add Element". The new element (arrow) will appear which corresponds to preprevious value. And so on. To initialize shift registers before execution of the loop you have to wire the some data from the outside.
    Another solution of your problem is using of local variables. You can create them from pop up menu of each control or indicator on the diagram. You can set them as read or write local.
    Good luck.
    Read help.
    Oleg Chutko.
    Attachments:
    shift.vi ‏16 KB

  • Powershell script - how to read a registry hive and store the value in text file and then again read the text file to write the values back in registry

    Hi All,
    powershell script Method required to read a value from registry and then taking the backup of that values in some text file.
    For example the hive is
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
    and under path i need to take back up  of values in some text file and then put some value in the registry after back is taken in text file.
    Also how to read the text file values so that we can again write to registry hive  back from the back up text file.
    Your help is much appreciated.
    Umeed4u

    I think you need to read this first:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to read out and modify text parts in a pdf-document?

    Hello,
    My problem is the following: I want to read out text passages of an existing pdf-file, compare them with files in an odbc-database and write down the results of that comparison in the same pdf-file. The term is: Read out a number in the file, search the database for the matching user-name, generate a field in the pdf and write down the search results in that.
    i have read that this could be possible with acrobat...my version is an acrobat 9 pro extended...
    could someone please tell me how to do that?
    big thanks

    As the definition of “color” vs. “black and white” differ by context – there aren’t any that I am aware of.
    You can, however, use the Preflight feature built into Acrobat to identify whatever you wish…

Maybe you are looking for

  • HT4623 My computer is saying that my iphone is no longer on my computer therefore I am unable to update. Any help?

    My computer is saying that my iphone is no longer in my computer therefore I am unable to sync or download. Can someone help me? I want to know how to find my iphone

  • Insertion too large on Solaris

    Hi i try to insert some rows in a table but i have troubles My client system is solaris 2.8 and my database is oracle 10 my table own a field of 180 Varchar2 but when i try to insert a value whith accents like 'é' i have an error : ERROR at line 4: O

  • IMAP - "Timed out"

    Every since switching to Leopard (10.5) Mail 3.0 has been messed up. It keeps timing out on the IMAP accounts over and over again. Sometimes it goes through, sometimes all 8 of my accounts (same server) get the message: "There may be a problem with t

  • Where to set external system credential?

    Hi, I am trying to use external system (business system) to post message. Then I noticed I cannot find somewhere to set the password (also refer as "secret key" as in "POST /api/external_systems/authentication") In another thread, it was mentioned: "

  • Ticker in SUN idm....

    When we log in into the Identity Manager , we have a option of enabling or disabling the TICKER. What i found is, that this ticker is being called from the idm/home/index.jsp which references the following class.... com.waveset.ui.web.home.TickerGene