PLEASE SEE THAT ANY ERROR IN THIS PROGRAM
import java.sql.*;
public class DB
public static void main(String[] args)throws SQLException{
Class.forname("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:bharat";
Connection conn=DriverManager.getConnection(url);
Statement stmt=conn.createStatement();
sqlString=select"select empno,empname from emprecord";
ResultSet rs=stmt.executeQuery(sqlString);
while(rs.next()){
System.out.println("rs.getInt"empno"");
System.out.println("rs.getString"empname"");
}}}
I think this is better:this would be much better:
package cruft;
import java.sql.*;
public class DB
private static final String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
private static final String URL = "jdbc:odbc:bharat";
private static final String SELECT_SQL = "select empno,empname from emprecord";
public static void main(String[] args)
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try
Class.forName(DRIVER);
conn = DriverManager.getConnection(URL);
stmt = conn.createStatement();
rs = stmt.executeQuery(SELECT_SQL);
while (rs.next())
int empno = rs.getInt(1);
String empname = rs.getString(2);
System.out.println("emp # : " + empno);
System.out.println("emp name: " + empname);
catch (ClassNotFoundException e)
e.printStackTrace();
catch (SQLException e)///////////// CHANGE HERE
e.printStackTrace();
catch (Exception e)////////////// CHANGE HERE (Optional)
e.printStackTrace();
finally
try { if (rs != null) rs.close(); } catch (Exception e) { e.printStackTrace(); }
try { if (stmt != null) stmt.close(); } catch (Exception e) { e.printStackTrace(); }
try { if (conn != null) conn.close(); } catch (Exception e) { e.printStackTrace(); }
}
Similar Messages
-
Before nothing happened until just recently when box messages would appear and tell me to click "yes or no" if I want the program to change my laptop. I clicked "No", but sometimes it didn't work, and when it didn't work. When it failed, fire fox changed some of the settings in my laptop. For example, the task bar's color would be changed. Also, it seemed as if fire fox had changed some of the settings into an old version. Yesterday I restarted my laptop, and it just went back to normal like nothing happened. But, for a few minutes later, the box will appear and you have to click yes or no. I clicked the "x" button, and it just changed automatically.
Check that you do not run Firefox as Administrator.<br />
Right-click the Firefox desktop shortcut and choose "Properties".<br />
In the Compatibility tab, make sure that Privilege Level: "Run this program as Administrator" is not selected.<br />
You also need to check the Properties of the firefox.exe program in the Firefox program directory.<br /> -
PLEASE CAN SOMEOME HELP ME INSTALL THIS PROGRAM????
PLease can someone help me install this program?? I am not computer literate.
What program specifically are you struggling with? What operating system are you using? What happens when you try?
-
hello! i am new to Macbook pro, i have recently transferred my data from my Pc to Mac, i can not open .exe file. Please give me any suggestion regarding this!
I have using Mac OS 10.9.2Try running it through WineSkin or CrossOver Mac, or installing Windows through VirtualBox, Parallels Desktop, VMware Fusion, Boot Camp, or similar software.
(106527) -
Please try to find out error in this program
Hi abapers,
when i execute this report , i got the error. please anybody find the error "Runtime Errors GETWA_NOT_ASSIGNED"
Short text
Field symbol has not yet been assigned." this error i got..
please help me..
REPORT ZBLOCKED_ALV_CLS.
*Data Objects to avoid tables work area.
DATA: V_KUNNR TYPE KNA1-KUNNR,
V_LIFNR TYPE LFA1-LIFNR.
*Logiv to maintain frist block.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: CUSTOMER FOR V_KUNNR.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: VENDOR FOR V_LIFNR.
SELECTION-SCREEN END OF BLOCK B2.
TYPES: BEGIN OF TY_VBAK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
END OF TY_VBAK.
TYPES: BEGIN OF TY_EKKO,
EBELN TYPE EBELN,
AEDAT TYPE ERDAT,
END OF TY_EKKO.
DATA: WA_VBAK TYPE TY_VBAK,
WA_EKKO TYPE TY_EKKO,
I_VBAK TYPE STANDARD TABLE OF TY_VBAK,
I_EKKO TYPE STANDARD TABLE OF TY_EKKO.
TYPE-POOLS: SLIS.
DATA: REPID TYPE SY-REPID.
DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
FCAT TYPE SLIS_FIELDCAT_ALV,
F_VBAK LIKE STANDARD TABLE OF FCAT,
F_EKKO LIKE STANDARD TABLE OF FCAT,
I_EVENTS TYPE SLIS_T_EVENT.
START-OF-SELECTION.
REPID = SY-REPID.
* REPID TYPE SY-REPID.
PERFORM: GET_DATA,
COL_HEAD.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = F_VBAK
I_TABNAME = 'I_VBAK'
IT_EVENTS = I_EVENTS
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = I_VBAK
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 2
* OTHERS = 3
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = LAYOUT
IT_FIELDCAT = F_EKKO
I_TABNAME = 'I_EKKO'
IT_EVENTS = I_EVENTS
* IT_SORT =
* I_TEXT = ' '
TABLES
T_OUTTAB = I_EKKO
* EXCEPTIONS
* PROGRAM_ERROR = 1
* MAXIMUM_OF_APPENDS_REACHED = 2
* OTHERS = 3
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM GET_DATA .
SELECT VBELN ERDAT FROM VBAK INTO TABLE I_VBAK WHERE KUNNR IN CUSTOMER.
SELECT EBELN AEDAT FROM EKKO INTO TABLE I_EKKO WHERE LIFNR IN VENDOR.
ENDFORM. " GET_DATA
*& Form COL_HEAD
* text
* --> p1 text
* <-- p2 text
FORM COL_HEAD .
PERFORM BUILD_CAT USING:
'VBELN' 'VBAK' 'VBELN' 'I_VBAK' 'SD',
'ERDAT' 'VBAK' 'ERDAT' 'I_VBAK' 'SD',
'EBELN' 'EKKO' 'EBELN' 'I_EKKO' 'MM',
'AEDAT' 'EKKO' 'AEDAT' 'I_EKKO' 'MM'.
ENDFORM. " COL_HEAD
*& Form BUILD_CAT
* text
* -->P_0238 text
* -->P_0239 text
* -->P_0240 text
* -->P_0241 text
* -->P_0242 text
FORM BUILD_CAT USING VALUE(P_0238)
VALUE(P_0239)
VALUE(P_0240)
VALUE(P_0241)
VALUE(P_0242).
CLEAR FCAT.
IF P_0242 = 'SD'.
FCAT-REF_FIELDNAME = P_0238.
FCAT-REF_TABNAME = P_0239.
FCAT-FIELDNAME = P_0240.
FCAT-TABNAME = P_0241.
APPEND FCAT TO F_VBAK.
ENDIF.
IF P_0242 = 'MM'.
FCAT-REF_FIELDNAME = P_0238.
FCAT-REF_TABNAME = P_0239.
FCAT-FIELDNAME = P_0240.
FCAT-TABNAME = P_0241.
APPEND FCAT TO F_VBAK.
ENDIF.
ENDFORM. " BUILD_CAT
Thanks,
Vinay.
Edited by: abapvinay on Apr 19, 2011 4:56 AMHi,
You have passed as shown below :
IF p_0242 = 'SD'.
fcat-ref_fieldname = p_0238.
fcat-ref_tabname = p_0239.
fcat-fieldname = p_0240.
fcat-tabname = p_0241.
APPEND fcat TO f_vbak.
ENDIF.
IF p_0242 = 'MM'.
fcat-ref_fieldname = p_0238.
fcat-ref_tabname = p_0239.
fcat-fieldname = p_0240.
fcat-tabname = p_0241.
APPEND fcat TO f_vbak. " Change this to F_EKKO
ENDIF.
Hope this helps
Regards,
Madhukar Shetty -
package hall;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
/** Simple servlet that reads three parameters from the form data.
* Part of tutorial on servlets and JSP that appears at
* http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
* 1999 Marty Hall; may be freely used or adapted.
public class ThreeParams extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Reading Three Request Parameters";
out.println(ServletUtilities.headWithTitle(title) +
"<BODY>\n" +
"<H1 ALIGN=CENTER>" + title + "</H1>\n" +
"<UL>\n" +
" <LI>param1: "
+ request.getParameter("param1") + "\n" +
" <LI>param2: "
+ request.getParameter("param2") + "\n" +
" <LI>param3: "
+ request.getParameter("param3") + "\n" +
"</UL>\n" +
"</BODY></HTML>");
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
the error is something like,
ThreeParams.java:20:cannot find symbol
symbol: variable ServletUtilities
location:class hall.ThreeParams
out.println(ServletUtilities.headWithTitile(title) +
^
something like that, i do know that the package hall could be the problem, but where can i find that package and where do i put it. thank you. and about this program(that i saw in http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/), well, i really need it as a reference, that is why i need to work on this one. once again, thank you...hi :-)
put your ThreeParams in the folder hall :-)
to resolve the issue in package,
but for ServletUtilities, im not sure where they got that,
i dont see in any part of the code that import or create an instance
for ServletUtilities :-( better to check the code for typo error
or contact the author regarding ServletUtilities.
regards, -
Error message "This program cannot display the webpage when uploading images to Cafe Press
I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
Most likely causes:
• You are not connected to the Internet.
• The website is encountering problems.
• There might be a typing error in the address.
What you can try:
Check your Internet connection. Try visiting another website to make sure you are connected.
Retype the address."
I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
Server not found
Firefox can't find the server at members.cafepress.com.
* Check the address for typing errors such as
ww.example.com instead of
[url=http://www.example.com]www.example.com[/url]
* If you are unable to load any pages, check your computer's network connection.
* If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
Nancy
http://www.cafepress.com/calendarflrSounds like your desktop application is in fact running from
a server. CHMs were identified as a security risk by Microsoft and
are best suited to the user's PC.
Click
here for more information. -
Could you please provide me any inputs for this interesting requirement
Hi Experts,
I need to create a <b>report to diplay all reports</b> (such as z or A or any reports) <b>accessible through the SA38</b>, its title, last used (in past 1 year), how many time it was used per past 1 year, and number of different users. Any inputs on this would be very much helpful.
Thanks in advance,
VivenInteresting but not possible, to do that you need to have already implemented a trace function inside each program one year ago.
SAP didn't save this kind of data.
You could always have a look of the transaction STATTRACE.
Fred -
I'm deeply worried. About to digitalize my entire CD collection, but can't continue until this problem is solved, or i'll risk slowly loosing my music. Song by song. Discovered the problem while browsing the Itunes library, when I realised that for example song number 2 and 11 was missing from one album, and 4 and 7 from another album. Very strange. When browsing the when I found lots of people experiencing the same. I'm using the 2011 Macbook Pro, and the Itunes library is on the Macbook Pro harddrive.
Hope someone can help....just want to add that i use Itunes 10.4.1. But I can see that users have problems with many versions.
I have an ipod shuffle that i connect once and a while. But the songs that are dissappearing are not the ones on the ipod as far as i can see... -
Does any one know this program??
Has anyone tried this.????
http://www.pixela.co.jp/oem/sony/e/captympeg_editex/index.html
I've just got a Sony DCR-SR30 as a gift......I like the camera, but also having difficulties importing the videofiles to imovie.
The instruction manual recommends the above mentioned program for mac users.
I'm not happy about spending another 80 euro (starts out with 50, but after customs and so on it ends up around 80 euro) on a program that I know nothing about. The shop where the camera was bought didn't give any warnings about being a mac user. But it seems the only option apart from changing the camera or ??
At least I would like to hear your experiences before buying.
I'm easily able to import photos to iphoto. there's no firewire output in the camera or the dock(station) only USB
Please adviseHi k
A reflex response:
If Your movie is stored on a hard disk in Your Camera it has to be compacted
in one way or another - most probably mpeg2 or mpeg4 (my guess).
This results in a quality loss when reconverted to streamingDV for iMovie or
FinalCut (Express or pro).
Hard disk Cameras is for people who doesn't intend to edit and doesn't need
full quality.
For iMovie and FinalCut (Express or pro) miniDV or DV-PRO is the working
(quality) way.
The material is compacted on miniDV tapes also BUT in a nondestructive
(information losing) form. So what You get into Your editing program is
full quality movie.
Yours Bengt W -
when closing browser, previous version used to have a pop up window that asked if I wanted to remember the open tab locations and then when I reopened the browser it would automatically open those tabs. this is no longer working in version 10.
Firefox 4 and later versions save the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
Use "Firefox > Quit Firefox" if you want to restore multiple windows or otherwise have problems with restoring tabs.<br />
You can use "History > Restore Previous Session" to get the previous session at any time.<br />
You may need to click the orange/gray Firefox button to see History.<br />
There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.
Using the "Show my windows and tabs from last time" setting is a more reliable way to restore session data.
* Firefox > Preferences > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time" -
Problem with UTL_FILE (please see my last post on this thread)
Hi all,
I'm trying to get the code (procedures, functions, etc) of my schemas. I've tried it using DBMS_METADATA.GET_DDL but it fails with many objects. Finally, I'm trying to create a procedure to extract the code.
I've created this two procedures:
CREATE OR REPLACE PROCEDURE spool_code (code IN varchar2, propi IN varchar2) is
CURSOR codigo is
select text from dba_source where name = code and owner = propi order by line;
line varchar2(4000);
BEGIN
open codigo;
loop
fetch codigo into line;
exit when codigo%notfound;
dbms_output.put_line(line);
end loop
close;
END;
CREATE OR REPLACE PROCEDURE ext_codigo is
CURSOR objeto is
select object_name, owner from dba_objects where object_type in ('PROCEDURE','FUNCTION','PACKAGE')
and owner not in ('OUTLN','DBSNMP','SYSTEM','SYS','REPADMIN','PERFSTAT','SPOTLIGHT','MONITOR','PRUEBAS','TOAD')
and status='VALID';
nom varchar2(128);
owner varchar2(30);
BEGIN
open objeto;
loop
fetch objeto into nom, owner;
exit when objeto%notfound;
spool_code(nom, owner);
end loop;
close objeto;
END;
And I'm calling from sqlplus to spool it:
SQL> spool Users_code.sql
SQL> exec ext_codigo;
But it don't bring me results...
where is the problem??
Thanks in advance for your support!
dbajug
Edited by: dbajug on Aug 29, 2012 6:36 AMHi,
yes guys, I've set serverout on using the max limit but, always fails with:
ERROR at line 1:
ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
ORA-06512: at "SYS.DBMS_OUTPUT", line 35
ORA-06512: at "SYS.DBMS_OUTPUT", line 198
ORA-06512: at "SYS.DBMS_OUTPUT", line 139
ORA-06512: at "SYS.SPOOL_CODE", line 15
ORA-06512: at "SYS.EXT_CODIGO", line 17
ORA-06512: at line 1
I'm working with a 9i version trying to extract the code to migrate it to a 11g.
In order to avoid the buffer error, I've decide use the UTL_FILE package but I'm having another problem: my procedure now is this
CREATE OR REPLACE PROCEDURE spool_code (code IN varchar2, propi IN varchar2) is
CURSOR codigo is
select text from dba_source where name = code and owner = propi order by line;
line varchar2(4000);
out_file UTL_FILE.File_Type;
BEGIN
begin
out_file := UTL_FILE.Fopen('/export/home/oracle', 'Users_code.sql', 'w');
exception
when others then
dbms_output.put_line('Error opening file');
end;
open codigo;
loop
fetch codigo into line;
exit when codigo%notfound;
UTL_FILE.Put_Line(out_file, line);
end loop;
close codigo;
UTL_FILE.Fclose(out_file);
END;
The directory exists and the file too but fails with this error:
ERROR at line 1:
**ORA-29282: invalid file ID**
ORA-06512: at "SYS.UTL_FILE", line 714
ORA-06512: at "SYS.SPOOL_CODE", line 23
ORA-06512: at "SYS.EXT_CODIGO", line 17
ORA-06512: at line 1
any idea? about the reason? The file is a text file on the server:
ls -lrt /export/home/oracle/Users_code.sql
-rw-rw-r-- 1 oracle dba 0 Aug 29 14:43 /export/home/oracle/Users_code.sql
best regards,
dbajug -
reminder for downloading the new version of flash player continues to happen. I have downloaded and installed it and I get an alert that it has already been installed and do you want to replace it. What is going on with this.
Hi Pilaar39, Please let me know if you are still having problems or have found a solution.
Thanks,
eidnolb -
Any help with this program (a bit of a problem with static references)
Can anyone give me any suggestions for fixing this code:
package vivarium;
import javax.swing.JApplet;
import javax.swing.JFrame;
import java.awt.*;
import java.applet.*;
import java.net.*;
public class Render extends java.applet.Applet {
static Animal[] animal_array_world;
public static void main(String s[]) {
JFrame frame = null;
Graphics g = null;
int[][] grassarray = new int[16][16];
createapplet(frame);
Render r = new Render();
r.rendergrass(g, grassarray);
frame.paint(g);
//createcreatures(20);
//live();
public void rendergrass(Graphics g, int[][] array) {
URL codebase = getCodeBase();
java.awt.Image grass = getImage(codebase, "grass.JPG");
java.awt.Image deadgrass = getImage(codebase, "deadgrass.JPG");
for(int i = 0; i < 16; i++)
for(int j = 0; j < 16; j++) {
int y = (i * 16);
int x = (j * 16);
if(array[i][j] == 0) {
drawimage(g, grass, y, x);
else
drawimage(g, deadgrass, y, x);
public void drawimage(Graphics g, java.awt.Image img, int y, int x) {
g.drawImage(img, y, x, this);
public static void createapplet(JFrame frame) {
frame = new JFrame();
frame.setTitle("Kirby's Vivarium Demo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JApplet applet = new RenderApplet();
applet.init();
frame.getContentPane().add(applet);
frame.pack();
frame.setVisible(true);
//this creates an array of creatures
public static void createcreatures(int x) {
animal_array_world = new Animal[x*2];
//this will than act on that
public static void live() {
while(true) {
int i = 0;
while(i != animal_array_world.length - 1) {
animal_array_world.live(animal_array_world);
The problem seems to be with
URL codebase = getCodeBase();
java.awt.Image grass = getImage(codebase, "grass.JPG");
java.awt.Image deadgrass = getImage(codebase, but I do not get how. This is a non-static field, but no matter what I do it seems to complain in some manner. Does anyone have any suggestions? Thanks!Exception in thread "main" java.lang.NullPointerException
at java.applet.Applet.getCodeBase(Unknown Source)
at vivarium.Render.rendergrass(Render.java:29)
at vivarium.Render.main(Render.java:20)I get this despite whether I put the getCodeBase part in a method, the main or the initialization block.
Heres line 29: URL codebase = getCodeBase();This is called within my nonstatic method rendergrass.
And heres line 20: r.rendergrass(g, grassarray);(Where r is a new Render class object) -
Okay, for the past week or two my iTunes library has been popping this error message up as soon as I open iTunes, then it all just shuts down. I've tried re-installing iTunes and deleting it, but nothing works. I keep receiving the same message. Please help me!
Hi there Megan_Hayley,
If you are experiencing this issue in Windows, then you may find the troubleshooting steps in the article below helpful.
iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
http://support.apple.com/kb/ts1717
-Griff W.
Maybe you are looking for
-
How can i connect plex app with time capsule
i have a time capsule 2TB and iphone 5s and ipad mini 2 i stored all my movies on the TC and i can acces them by imac and apple tv i just bought plex for ipad and iphone and don't now how to connect to TC i want play these movies by ipad by plex conn
-
Firefox hangs at random times (mostly when java or flash is launched) mostly after some time killing proces plugin-containter not unfreezing firefox , killing firefox proces is only solution for now I trayed to launch ff in console and use ff until f
-
Hi, Quick Question, I want to do a movement between SLOCs so I am using MB1B. I have it configured so when I click Save it automatically creates a TO in the foreground which is how i want it. The Question is that when the TO is created, the Destinati
-
Edit, Crop, Custom Select Everybloody time???
I must be missing something but in the last version of iPhoto I would double click a series of pics then hit edit. I would crop the pic to a custom size then click the arrow to save and go to the next pic to crop etc... Now I have to hit the crop but
-
Can I transfer a new group I created in contacts to my iPhone?
I'm not sure where to put this query, but since it has to do with something on my MAC, I hoped that this is the right place. I have created a new group for specific contacts, and I would llike to transfer that group to the contacts on my iPhone 4S.