LINUX下使用.sql脚本,不知道是那里写错了!求解答!

进入oracle用户后获取DBA权限运行.sql文件
sqlplus / as sysdba @create_user.sql
以下是.sql文件命令,主要是用来创建表空间和用户的。
------------------------创建表空间---------------------------
CREATE TABLESPACE ids DATAFILE '/u01/oradata/orcl/ids.dbf' SIZE 200m AUTOEXTEND ON NEXT 300M MAXSIZE UNLIMITED;
-------------------------创建用户----------------------------
CREATE user ids identified by ids default tablespace ids temporary tablespace TEMP profile DEFAULT;
----------------------给用户分配权限-------------------------
Grant dba to ids;
--------------------------提交-------------------------------
commit;

运行.sql文件后报错。
Connected to an idle instance.

CREATE TABLESPACE ids DATAFILE '/u01/oradata/orcl/ids.dbf' SIZE 200m AUTOEXTEND ON NEXT 300M MAXSIZE UNLIMITED
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

CREATE user ids identified by ids default tablespace ids temporary tablespace TEMP profile DEFAULT
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

Grant dba to ids
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

commit
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

是缺少什么?
求大神解答!

3个回答

oracle没有连接上,报的是不可用错误

你的数据库实例还没有开启
sqlpuls / as sysdba
startup

oracle实例启动没?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
不知道是哪里错了,求解答。
int[][] a = new int[3][5];rnrn我是想声明这样一个3行5列的二维数组,可是在“5”的下面提示:无效的秩说明符,是什么意思啊?
这一句sql那里写错了?
Public Function GetParentArticle(ByVal itemid As Integer) As DataSetrn conn.Open()rn access = "select * from articles a, users u where a.username = u.username and a.parentid = '0' and a.itemid =" & itemid.ToStringrnrnrn################################################rnrn itemid = Convert.ToInt32(Request.Params("itemid").ToString) rnrn提示类型不匹配。rn
求救,不知道那里错了?
写一个禁区问题,就是病人在某个初始位置(0,0),只能通过对轮椅发出指令来移动,指令有方向和速度。主函数里的data里记录了病人输入的全部指令。想判断病人是否离开过(0,0)到(400,200)的禁区。感觉写的很小心,应该没错啊,但是报一些看不懂的错。rnrn代码:rn#includern#includern#includernrn#define MAX 100rntypedef structrnrn double t1;rn double t2;rn double speed;rn double angle;rnorder; //指令rnrntypedef structrn rn double x;rn double y;rnposition;rnrndouble total_dis(0);rndouble Pi(3.1415926);rnposition farest_pos;rnrnfarest_pos.y=0;rnfarest_pos.x=0; rnposition trans_position(position pos1,double t1,double t2,double speed,double angle) rnrn double x_cal,y_cal,distance;rn position pos2;rn distance=(t2-t1)*speed;rn total_dis+=distance;rn x_cal=distance*(cos(angle/180*Pi));rn y_cal=distance*(sin(angle/180*Pi));rn pos2.x=pos1.x+x_cal;rn pos2.y=pos1.y+y_cal;rn return pos2;rnrnrnint judge_position(position pos)rn rn int sem=0;rn if((pow(pos.x,2)+pow(pos.y,2))>(pow(farest_pos.x,2)+pow(farest_pos.y,2)))rn rn farest_pos.x=pos.x;rn farest_pos.y=pos.y;rn rnrn if(pos.x<0||pos.x>400||pos.y<0||pos.y>200)rn rn sem++;rn //printf("Yes,The patient had walked out!\n");rn rn return sem;rnrnrnrnrnmain()rn order data[MAX];rn position pos1,pos_p;rn int i,sem_m,sem_first,sem_p;rn double j;rnrn farest_pos.y=0;rn farest_pos.x=0;rn rn for(i=0;i<4;i++)rn rn data[i].t1=0; data[i].t2=5; data[i].speed=3;data[i].angle=0;rn data[i].t1=7; data[i].t2=9; data[i].speed=2;data[i].angle=30;rn data[i].t1=10; data[i].t2=100; data[i].speed=4;data[i].angle=60;rn data[i].t1=110; data[i].t2=200; data[i].speed=2;data[i].angle=0;rn rn rn sem_first=0;rn pos1.x=pos1.y=0;rn for(i=0;i
不知道那里错了
org.apache.jasper.JasperException: Exception in JSP: /main.jsp:35rnrn32: ResultSet rs ;rn33: DB db = new DB();rn34: rs = db.selectSqlResult("select * from t_Item");rn35: while(rs.next())rn36: out.println(rs.getString(1));rn37: rn38: %>rn---------------------rn<%@ page import="java.sql.ResultSet" %>rn都打了rn
不知道那里错了。
$email="test@163.com";rn $parten="/^(a-zA-Z0-9)+[@]1(a-zA-Z0-9)+[.]1(a-zA-Z)$/";rn if(preg_match($parten,$email))rn echo "EMAIL正确";rn elsern echo "EAMIL不正确";rn rn正则表达不知道那里错了,请高手那里写错了?
不知道代码那里错了
我用Microsoft Access建立一个数据库,里面有一个汉字拼音对照表(表名duizhaobiao),有两个字段(hz 文本,大小2;py 文本,大小:1)rn在程序中我想在sle_1.text中输入汉字,在sle_2.text中显示对应的拼音。我写了以下代码:rnstring a[],str,t,brnint irnstr=trim(sle_1.text)rnfor i=1 to len(str)/2 rn a[i]=mid(str,i,1)rn b=a[i]rn messagebox('',b)rn select pyrn into:trn from duizhaobiaorn where hz=:b;rn if sqlca.sqlcode=0 thenrn sle_2.text=sle_2.text+trn elsern messagebox('','没找到')rn end ifrnnextrn可是运行时提示没找到。在数据库画板中写sql语句却能找到。不知道什么原因。请各位指教。
不知道那里写错了,为什么1>total??
<% if mid > total then %> <% end if %> > <%=response.write (" ")%>rnrn不论mid和total等于什么数,mid总是>total,奇怪!rnmid和total都是number,为什么是这样的呢?
菜鸟求纠错!!!实在不知道那里错了!!
这个是我的程序,是书后面一个作业!rn#includern#includernvoid main()rnrn int h;rn double c,s1,s2,v2,v3,r,pi=3.14;rn scanf("r=%.1f,h=%d",&r,&h);rn c=2*pi*r;rn s1=pi*r*r;rn s2=4*pi*r*r;rn v2=4/3*pi*r*r*r;rn v3=pi*r*r*h;rn printf("圆周长=%.4f,圆面积=%.4f,球面积=%.4f,球体积=%.4f,圆柱体积=%.4f\n"c,s1,s2,v2,v3);rnrnrnrn报错信息是:rnd:\program files\vc6\myprojects\das\fas.c(13) : error C2146: syntax error : missing ')' before identifier 'c'rnd:\program files\vc6\myprojects\das\fas.c(13) : error C2059: syntax error : ')'rn
不知道哪里出错了,求大神解答!!!
定义2个二维整型数组,每个数组元素都>=8个,但个数不能相同,1个数组在定义时初始化元素,另一个数组通过键盘输入元素,分别输出2个数组中的所有元素(要求:按照矩阵格式输出)rnrn```rn#include rnint main()rn rn int a[] = 1,2,3,4,5,6,7,8, b[9];rn int n = 9;rn for (int i = 0; i < n; i++)rn rn scanf("%d", &b[i]);rn rn printf("A数组:rn");rn for (int i = 0; i < 8; i++)rn rn if (i && i % 4 == 0) printf("rn");rn printf("%d ", a[i]);rn rn printf("B数组:");rn for (int i = 0; i < n; i++)rn rn if (i && i % 3 == 0) printf("rn");rn printf("%d ", b[i]);rn rn printf("rn");rn return 0;rnrn```
这样写那里错了?
NTSTATUS rnDriverEntry(IN PDRIVER_OBJECT pDriObj,IN PUNICODE_STRING pRegPath)rnrn ...rn //Attach Devicern status = IoAttachDevice(g_DevObj,&DevName,&g_OldDevObj);rn ...rnrnrnNTSTATUS TdiCreateAddrComplate(IN PDEVICE_OBJECT pDevObj,IN PIRP Irp,IN PVOID Context)rn PIO_STACK_LOCATION Irps = IoGetCurrentIrpStackLocation(Irp);rn PIRP QueryIrp = (PIRP)Context;rn TDI_ADDRESS_INFO *pTai = (TDI_ADDRESS_INFO *)ExAllocatePool(NonPagedPool,sizeof (TDI_ADDRESS_INFO_MAX));rn NTSTATUS status;rn rn if(pTai != NULL)rn PMDL pMdl = IoAllocateMdl(pTai,sizeof(TDI_ADDRESS_INFO_MAX),FALSE,FALSE,NULL);rn if (pMdl != NULL) rn MmBuildMdlForNonPagedPool(pMdl);rn if (QueryIrp != NULL) rn TdiBuildQueryInformation(QueryIrp,g_OldDevObj,Irps->FileObject,NULL,NULL,TDI_QUERY_ADDRESS_INFO,pMdl);rn status = IoCallDriver(g_OldDevObj,QueryIrp);//调用会蓝屏rn rnrnrn return status;rnrnrnNTSTATUS TdiCreate(IN PDEVICE_OBJECT pDevObj,IN PIRP Irp)rn PIO_STACK_LOCATION Irps = IoGetCurrentIrpStackLocation(Irp);rn FILE_FULL_EA_INFORMATION *pEA = (FILE_FULL_EA_INFORMATION *)Irp->AssociatedIrp.SystemBuffer;rn PIRP QueryIrp;rn NTSTATUS status;rn rn if(pEA->EaNameLength == TDI_TRANSPORT_ADDRESS_LENGTH \rn&& memcmp(pEA->EaName,TdiTransportAddress,TDI_TRANSPORT_ADDRESS_LENGTH) == 0)rnQueryIrp = TdiBuildInternalDeviceControlIrp(TDI_QUERY_ADDRESS_INFO,g_OldDevObj,Irps->FileObject,NULL,NULL);rnIoSkipCurrentIrpStackLocation(Irp); rnIoSetCompletionRoutine(Irp,TdiCreateAddrComplate,QueryIrp,TRUE,TRUE,TRUE);rnstatus = IoCallDriver(g_OldDevObj,,Irp);rn rn elsern if(g_OldDevObj != NULL)rn IoSkipCurrentIrpStackLocation(Irp);rn status = IoCallDriver(g_OldDevObj,Irp);rn rn elsern status = Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;rn IoCompleteRequest (Irp, IO_NO_INCREMENT);rn rn rn rnreturn status;rnrn
我那里写错了?
#include "stdafx.h" rn#include rn#include rn#include rn rnclass choice rn rn int x; rnpublic: rn choice(); rn void Se(void); rn void show(void); rn; rnchoice::choice(); rn rn x=0; rn rn rnvoid choice::Se(void) rn rn srand((unsigned)time(NULL)); rn x=rand()%101; rn rn rnvoid choice::show(void) rn rn cout<
这样写那里错了?!
web.config:rn---------------------------------------------------rnrn rn rn rn rn rn rnrn---------------------------------------------------rn怎么题是第三行出错!rn我将相关的文件都放在一个虚拟目录下,应该没有问题吧!
那里写错了?
rn[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]rn struct NCCALCSIZE_PARAMS rn rn [MarshalAs(UnmanagedType.ByValArray , ArraySubType = UnmanagedType.Struct, SafeArrayUserDefinedSubType = typeof(RECT), SizeConst = 3)]rn public RECT[] rgrc1;rn public IntPtr lppos; rn ; rnrnrn [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]rn struct WINDOWPOS rn rn IntPtr hwnd; rn IntPtr hwndInsertAfter; rn public int x; rn public int y; rn public int cx; rn public int cy; rn public int flags; rn ; rnrnrn [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]rn struct RECTrn rn public int left; rn public int top; rn public int right; rn public int bottom; rn ; rn
进制的转换 不知道那里错了
写了一段代码 是把0到1之间的8进制数转化为十进制数的rnimport java.util.*;rnpublic class Test3 rn public Test3()rn Scanner in = new Scanner(System.in);rn double m = in.nextDouble();rn String s = String.valueOf(m);rn double e = (double)1/8;rn double total =0.00;rn for(int i = 2;i
小程序,不知道那里错了。。。
11. public class Test rn12. public enum Dogs collie, harrier, shepherd;rn13. public static void main(String [] args) rn14. Dogs myDog = Dogs.shepherd;rn15. switch (myDog) rn16. case collie:rn17. System.out.print(”collie “);rn18. case default:rn19. System.out.print(”retriever “);rn20. case harrier:rn21. System.out.print(”harrier “);rn22. rn23. rn24. rnrn那里错了呢??
看了半天不知道那里错了!
#include rn#include rn#define PER_HR 10.00rn#define TAX_1 0.15rn#define TAX_2 0.20rn#define TAX_3 0.25rn#define E_HR 1.5rn#define A "1) $8.75/hr"rn#define B "2) $9.33/hr"rn#define C "3) $10.00/hr"rn#define D "4) $11.20/hr"rn#define E "quit"rnrnint main(void)rnrn float time,salary,tax;rn int n;rn char Ch;rnrn printf("How long do you work in this week?\n");rn scanf("%f",&time);rn for(n=0;n<80;n++)rn putchar('*');rn printf("Enter the number corresponding to the desired pay"rn " rate or action:\n");rn printf("1) $8.75/hr");rn for(n=0;n<40-strlen(A);n++)rn putchar(' ');rn printf("2) $9.33/hr\n");rn printf("3) $10.00/hr");rn for(n=0;n<40-strlen(C);n++)rn putchar(' ');rn printf("4) $11.20/hr\n");rn printf("5) quit\n");rn for(n=0;n<80;n++)rn putchar('*');rn printf("please input your salary rank.\n");rn if(time>40)rn time=1.5*(time-40)+40;rn while((Ch=getchar())!='5')rn rn switch(Ch)rn rn case '1':salary=time*8.75;rn break;rn case '2':salary=time*9.33;rn break;rn case '3':salary=time*10.00;rn break;rn case '4':salary=time*11.20;rn break;rn default:printf("Please input 1 to 5.\n");rn break;rn rn rn if(salary<=300)rn rn tax=TAX_1*salary;rn rn else if(salary>300&&salary<=450)rn rn tax=TAX_1*300+TAX_2*(salary-300);rn rn elsern rn tax=TAX_1*300+TAX_2*150+TAX_3*(salary-450);rn rn printf("Your all salary is %.2f,real salary is %.2f and tax is %.2f.\n",rn salary,salary-tax,tax);rn return 0;rn
帮忙看看sql语句,那里写错了。
如题:现有两个表member和consultant,需要更新member表中的内容,rn两个表的关系是id是相同的。rnrnUPDATE memberrnSET member.[group] = 4rnWHERE (member.id = consultant.id) AND (consultant.status = 2)rnrn麻烦看看,我哪里写错了rnrn谢谢,在线等rn
SQL,那里错了?
Dim ConnStr As String, SQL As Stringrn ConnStr = "Provider=Microsoft.Jet.OLEDB.3.51;" & "Persist Security Info=False;" & "Data Source=E:\学生档案库.mdb"rn conn.Open ConnStrrn rs.CursorLocation = adUseClientrn SQL = "Select AVG(年龄) as 平均年龄 From 学生基本情况表"rn rs.Open SQL, conn, adOpenKeyset, adLockPessimistic /*******Error***/rn Debug.Print rs("平均年龄")rn为什么这样打不开?rn实时错误:数据库引擎含有一个无效的数据类型字段,导致不能执行SQL语句!rn但是 SQL = "Select * From 学生基本情况表"可以执行SQL???
这句sql那里错了。
sql="select * from allad where title like '%"&serch&"%' or content like '%"&serch&"%' UNION ALL (select * from jpad where title like '%"&serch&"%' or content like '%"&serch&"%')"rn
这句sql那里错了?
select round(cur_charge/avg_charge,2) aa,cur_charge,avg_charge,state_timernfrom product_temp order by aarncur_charge,avg_charge都是number(10),数据库是oracle.rn出错信息是divisor is equal to zero.如果去掉order by ,则是正确的,但我需要的是排序的结果。大家看看哪里错了。
这个sql 那里错了
create or replace procedure print_current_time asrncurtime varchar(20);rnbeginrnselect * To_CHAR(sysdate,'yyyy/mm/dd hh24:mi:ss')rninto curtimernfrom dual;rnDBMS_OUTPUT.put_line('当前时间是:'||chr(9)||curtime);rnend print_current_time;rn/
求请教。。。。不知道哪里写错了
题目,输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输入数组。rn#includernint main()rnrn int a[10],max,min,i,t,y;rn printf("please enter 10 numbers:");rn for(i=0;i<10;i++)rn scanf("%d",&a[i]);rn for(i=1;i<10;i++)rn max=a[0];rn if(a[i]>max)max=a[i];t=max;max=a[0];a[0]=t;rn for(i=1;i<10;i++)rn min=a[0];rn if(a[i]
求解答 这个输出哪里写错了
是因为没有储存数据吗?rn为什么输出值只显示最后一个数据?rn[img=https://img-bbs.csdn.net/upload/201612/17/1481963641_390060.png][/img]
不知道是哪里错了
用的是WIN2000 ADVANCED SERVER,每次打开页面是都说rnHTTP 500.100 - 内部服务器错误 - ASP 错误rnInternet 信息服务rn错误类型:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80004005)rn/35511/eb2/data.inc, 第 7 行rnrnrn浏览器类型:rnMozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) rnrn但页面语句的确没问题,我想可能是IIS的缘故,但具体不太清楚,不知道是哪错了??rnrn附:data.inc<% rnSet Conn=Server.CreateObject("ADODB.Connection") rnrnConnstr="DBQ="+server.mappath("zygxmamenu.mdb")+";DefaultDir=;DRIVER=Microsoft Access Driver (*.mdb);Pwd=zydnxky11789;" rnrnConn.Open connstr rn %>rn
大家看看那里写错了
DECLARErnp_dblink VARCHAR2(128):= 'AA';rn V_sql VARCHAR2(10000);rn V_servername VARCHAR2(128);rnBEGINrnV_sql := 'SELECT NAME FROM INSTANCES WHERE LINK ='||p_dblink;rnexecute immediate V_sql INTO V_servername;rnDBMS_OUTPUT.PUT_LINE(V_servername);rnEND;rnrnrn写这种命令的时候||和'老是不知道怎么用.寒!!!!
我写的那里错了啊?
#include "stdafx.h"rn#include rn#include rn#include rnrnclass choicernrn int x;rnpublic:rn choice();rn void Se(void);rn void show(void);rnrnchoice::choice();rnrn x=0;rnrnrnvoid choice::Se(void)rnrn srand((unsigned)time(NULL));rn x=rand()%101; rn rnrnvoid choice::show(void)rnrn cout<
我写的函数,那里错了?
我写了一个获取TREEVIEW节点的函数不知那里错了,请各位指点!!rnpublic byte NodeLevel(TreeNode n)rn rn byte i=1;rn while(n.Parent==null)//这里错了!!!!!!!!!!!!!!!!!rn rn n=n.Parent;rn i += 1;rn rn return i;rn rn在VBNET里这样写是正确的:rnPublic Function NodeLevel(byval n As TreeNode) as byterndim i as byterndo until n.parent is nothingrnn=n.Parentrni+=1rnlooprnreturn irnend Functionrn
sql 写法 不知道哪里错了 求帮忙
UPDATE syjk_ccs_zjk SET motortypecode= rn(CASE rn when ratedpassengercapacity<6 ang vehicletype not like 'M%' then 11rn when ratedpassengercapacity>=6 and ratedpassengercapacity<10 then 12rn when ratedpassengercapacity>=10 and ratedpassengercapacity<20 then 13rn when ratedpassengercapacity>=20 and ratedpassengercapacity<36 then 14rn when ratedpassengercapacity>=36 then 15 rn else nullrnend); 报错 缺少关键字rnUPDATE syjk_a SET name= rn(CASE rn when code1<3 then 11rn when code1>=3 then 12rn else nullrnend); 我自己做了一个简单表就没错 rn不知道为什么
请问这段话那里写错了?
ls_sql="if exists(select * from kcckye where kcckye_kjnd="+ls_kjnd+" and kcckye_kjqj="+ls_kjqj+" and kcckye_ckbh="+ls_ckbh+""+&rn"and kcckye_wlbh="+ls_wlbh+") update kcckye set kcckye_jslj= kcckye_jslj+li_sl,kcckye_jfsl=kcckye_jfsl+li_sl "+& rn"where (kcckye_kjnd=:ls_kjnd and kcckye_kjqj=:ls_kjqj and kcckye_ckbh=:ls_ckbh and kcckye_wlbh=:ls_wlbh) "+&rn"else insert into kcckye(kcckye_kjnd,kcckye_kjqj,kcckye_ckbh,kcckye_wlbh,kcckye_jslj,kcckye_jfsl)values("+ls_kjnd+","+ls_kjqj+","+ls_ckbh+","+ls_wlbh+",'+li_sl+','+li_sl+')"rn
帮我看下,那里写错了!
[code=VBScript]rn ip=Request.ServerVariables("REMOTE_ADDR") rn id=request.QueryString("inv")rn sql="select * from [users] where id="&idrn rs.open sql,conn,1,3rn if file_type="1" then rn response.Write "我是1"rn if rs("pdf_ip1")="" then rs("pdf_ip1")=ip [color=#FF0000] '把这判断语句去掉就不出错![/color]rn elseif rs("pdf_ip2")="" then rs("pdf_ip2")=iprn elseif rs("pdf_ip3")="" then rs("pdf_ip3")=iprn elseif rs("pdf_ip4")="" then rs("pdf_ip4")=iprn elseif rs("pdf_ip5")="" then rs("pdf_ip5")=iprn end ifrn rn elseif file_type="2" thenrn response.Write "我是2"rn 'rs.updatern elsern response.Write "都不是"rn end if rn[/code]
请大侠们帮忙改错,我不知道那里写错了
rnrn rn rn rn rn rn rn rnrnprotected void Page_Load(object sender, EventArgs e) rn rn if (Session["yzm"].ToString() != "") rn rn Response.Write(Session["yzm"].ToString()); rn Response.End(); rn rn else rn rn Response.Write("Session 为空"); rn Response.End(); rn rnrnie提示说网页上有错误rn
第一回写oracle的存储过程,不知道那里错了很多
create or replace procedure UpdateSHGL_CJ(rn i_cjrq in date,rn i_hm in varchar(20),rn i_dqbh in number,rn i_hmlb in char(1),rn i_wxcj in number(10,2),rn i_bdhf in number(10,2),rn i_bdct in number(10,2),rn i_bdgj in number(10,2),rn i_yhl in number(10,2),rn i_dlsbh_sb in number(10,2)rn)rnasrnbeginrn--------------------------------------------------------rndeclare h1 in number(10,2);rndeclare s1 in number(10,2);rndeclare h2 in number(10,2);rndeclare s2 in number(10,2);rndeclare total1 in number(10,2);rndeclare total2 in number(10,2);rndeclare total3 in number(10,2);rndeclare A1 in number(10,2);rndeclare B1 in number(10,2);rndeclare C1 in number(10,2);rndeclare D1 in number(10,2);rndeclare F1 in int;rndeclare G1 in int ;rndeclare I1 in number(10,2);rndeclare F2 in int ;rndeclare G2 in int;rndeclare I2 in number(10,2);rndeclare E1 in int;rndeclare E2 in int;rndeclare i_yfcj in number(10,2);rndeclare i_hmcj number(10,2);rndeclare i_sbcj in number(10,2);rndeclare i_dlsbh in number;rndeclare i_sbdls in number;rndeclare i_hmcj in number(10,2);rndeclare i_sbcj in number(10,2);rn----------------------------------------------------------------rnset i_dlsbh = (select sum(dlsbh) from SHGL_CJQD where cjrq=i_cjrq);rnset i_sbdls=(select sum(dlsbh_sb) from SHGL_CJQD where cjrq=i_cjrq);rnset E1=30;rnset E2=60;rnset F1=100000;rnset G1=100;rnset I1=0.05;rnset F2=200000;rnset G2=100;rnset I2=0.10;rnset A1=i_bdhf;rnset B1=i_bdgj;rnset C1=i_bdct;rnset D1=i_yhl;rnset h1=0.49;rnset s1=0.41;rnset h2=0.25;rnset s2=0.25;rnset total1 = A1+B1+C1;rnset total2= i_bdct+(1/(3*B1));rnset total3=(1-D1)*total1;rn---------------------------------------rnif i_hmlb='1' thenrn if total2 >=E1 thenrn i_hmcj:=H1 * total3;rn i_sbcj:=S1* total3;rn end if;rn else rn if total1>=F2 thenrn if total1 >= G2 thenrn i_hmcj:=(H2+I2)*total1;rn i_sbcj:=S2*total1;rn end if;rn if (total2>=E2 and total=F1 and total1=G1 thenrn i_hmcj:= (H2+I1)*total1;rn i_sbcj:=S2*total1;rn end if;rn if (total2>=E2 and total2
刚学习线程 写一个时钟 不知道那里错了 指点下
[code=Java]/**rn * @(#)TimerTest.javarn *rn *rn * @authorrn * @version 1.00 2011/6/4rn */rnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnimport java.util.*;rnrnpublic class TimerTest rn public static void main (String args[])rn JFrame f=new TimerTestFrame();rn f.show();rn rnrnclass TimerTestFrame extends JFramern public TimerTestFrame()rn setSize(300,450);rn setTitle("Timeer Test");rn addWindowLisenter(new WindowAdapter()rn rn public void windowClosing(WindowEvent e)rn rn System.exit(0);rn rnrn );rn Container c=getContentPane();rn c.setLayout(new GridLayout(2,3));rn c.add(new ClockCanvas("San Jose", "GMT-8"));rn c.add(new ClockCanvas("Taipei", "GMT+8"));rn c.add(new ClockCanvas("Berlin", "GMT+1"));rn c.add(new ClockCanvas("New York", "GMT-5"));rn c.add(new ClockCanvas("Cairo", "GMT+2"));rn c.add(new ClockCanvas("Bombay", "GMT+5"));rn rnrninterface TimerListenerrn void timeElapsed(Timer t);rnrnclass Timer extends Threadrnrn private TimerListener target;rn private int interval;rnrn public Timer(int i, TimerListener t)rn target = t;rn interval = i;rn setDaemon(true);rn rnrn?rn public void run()rn rn tryrn rn while (!interrupted())rn rn sleep(interval);rn target.timeElapsed(this);rn rn rn catch(InterruptedException e) rn rnrn class ClockCanvas extends JPanel implements TimerListenerrn private int seconds = 0;rn private String city;rn private int offset;rn private GregorianCalendar calendar;rn private final int LOCAL = 16;rnrn public ClockCanvas(String c, String tz)rn rn city = c;rn calendar = new GregorianCalendar(TimeZone.getTimeZone(tz));rn Timer t = new Timer(1000, this);rn t.start();rn setSize(125, 125);rn rn? public void paintComponent(Graphics g)rn? super.paintComponent(g);rn g.drawOval(0, 0, 100, 100);rn double hourAngle = 2 * Math.PIrn * (seconds - 3 * 60 * 60) / (12 * 60 * 60);rn double minuteAngle = 2 * Math.PIrn * (seconds - 15 * 60) / (60 * 60);rn double secondAngle = 2 * Math.PIrn * (seconds - 15) / 60;rn g.drawLine(50, 50, 50 + (int)(30rn * Math.cos(hourAngle)),rn 50 + (int)(30 * Math.sin(hourAngle)));rn g.drawLine(50, 50, 50 + (int)(40 * Math.cos(minuteAngle)),rn 50 + (int)(40 * Math.sin(minuteAngle)));rn g.drawLine(50, 50, 50 + (int)(45 * Math.cos(secondAngle)),rn 50 + (int)(45 * Math.sin(secondAngle)));rn g.drawString(city, 0, 115);rn? rnrn? public void timeElapsed(Timer t)rn?rnrn calendar.setTime(new Date());rn seconds = calendar.get(Calendar.HOUR) * 60 * 60+ calendar.get(Calendar.MINUTE) * 60+ calendar.get(Calendar.SECOND);rn repaint();rn? rn [/code]
linux下如何将sql语句写为脚本
对数据库的一些操作我想在linux下面写成一个脚本,然后执行脚本,但不知道如何写.哪位大虾晓得~rnrn下面是对数据库ORACLE的操作rnsystem用户登录执行rndrop user ebnewmt cascadernrn-- Create the user rncreate user EBNEWMTrn identified by "123"rn default tablespace EBNEWMTrn temporary tablespace TEMPrn profile DEFAULT;rn-- Grant/Revoke role privileges rngrant connect to EBNEWMT;rngrant resource to EBNEWMT;rn-- Grant/Revoke system privileges rngrant unlimited tablespace to EBNEWMT;
decode那里为什么是错了
import java.awt.BorderLayout;rnimport java.awt.Color;rnimport java.awt.Container;rnimport java.awt.FlowLayout;rnimport java.awt.event.ActionEvent;rnimport java.awt.event.ActionListener;rnimport javax.swing.JApplet;rnimport javax.swing.JButton;rnimport javax.swing.JLabel;rnimport javax.swing.JTextField;rnrnpublic class Applet extends JAppletrn private JTextField textField;rn private JButton button;rn private String str;rn private Color color;rn private JLabel label;rn public void init() rn Container pane = getContentPane();rn pane.setLayout(new BorderLayout());rn textField = new JTextField();rn button = new JButton();rn label = new JLabel("请输入颜色:");rn rn pane.add(label, BorderLayout.WEST);rn pane.add(textField, BorderLayout.CENTER);rn button.setText("确定");rn pane.add(button, BorderLayout.EAST); rn rnrn public void start()rn button.addActionListener(new ActionListener() rn public void actionPerformed(ActionEvent e) rn str = textField.getText(); // 获取textField的值rn [color=#FF0000]color = Color.decode(str); // 转换为颜色[/color]rn textField.setText("pink");rn getContentPane().setBackground(color);rn rn ); rn rn
android使用JAXBContext包错了,求解答。
因为有需求要与传递xml格式的字符串(不是文件方式)。rn在网上搜了好半天,才知道JAXB,首先在建了个java工程来属性这个东西:[code=Java][/code]public static void main(String[] args) throws JAXBException, MalformedURLException rn JAXBContext context = JAXBContext.newInstance(Report.class);rn Marshaller shaller = context.createMarshaller();rn shaller.setProperty(Marshaller.JAXB_ENCODING, "gb2312");rn shaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);rn shaller.setProperty(Marshaller.JAXB_FRAGMENT, false);rn rn Report report = new Report();rn TsnSession tsnsession = new TsnSession();rn TsnSessions tsnsessions = new TsnSessions();rn tsnsession.setType(001);rn tsnsession.setUrl(new URL("http://www.baidu.com"));rn tsnsessions.setTsnInformation("00");rn tsnsessions.setTsnsession(tsnsession);rn tsnsessions.setTsnsession(tsnsession);rn report.setTsncode("1001");rn report.setTsnSessions(tsnsessions);rn rn shaller.marshal(report, System.out);rn rn rnrn跑出来的结果:[code=XML][/code]rnrn 1001rn rn rn http://www.baidu.comrn 1rn rn rn http://www.baidu.comrn 1rn rn rnrnrn然后满怀信心的我建了个android工程来测试,结果来问题了。在网上找了一天没找到答案,求解答,上代码:rn[code=Java][/code]public void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.main);rn btn = (Button) findViewById(R.id.main_btn);rn tv = (TextView) findViewById(R.id.main_tv);rnrn try rn context = JAXBContext.newInstance(Report.class);rn shaller = context.createMarshaller();rn shaller.setProperty(Marshaller.JAXB_ENCODING, "gb2312");rn shaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);rn shaller.setProperty(Marshaller.JAXB_FRAGMENT, false);rn catch (JAXBException e1) rn // TODO Auto-generated catch blockrn e1.printStackTrace();rn rnrn03-09 02:01:41.750: ERROR/AndroidRuntime(335): FATAL EXCEPTION: mainrn03-09 02:01:41.750: ERROR/AndroidRuntime(335): java.lang.VerifyError: pll.conect.Conect_testActivityrn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at java.lang.Class.newInstanceImpl(Native Method)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at java.lang.Class.newInstance(Class.java:1429)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.ActivityThread.access$2300(ActivityThread.java:125)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.os.Handler.dispatchMessage(Handler.java:99)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.os.Looper.loop(Looper.java:123)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at android.app.ActivityThread.main(ActivityThread.java:4627)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at java.lang.reflect.Method.invokeNative(Native Method)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at java.lang.reflect.Method.invoke(Method.java:521)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)rn03-09 02:01:41.750: ERROR/AndroidRuntime(335): at dalvik.system.NativeStart.main(Native Method)rnrnrn如果我把try/catch里面的代码写在静态块中:rn03-09 02:08:44.010: ERROR/AndroidRuntime(364): Caused by: java.lang.NoClassDefFoundError: javax.xml.bind.JAXBContextrn03-09 02:08:44.010: ERROR/AndroidRuntime(364): at pll.conect.Conect_testActivity.(Conect_testActivity.java:47)rn03-09 02:08:44.010: ERROR/AndroidRuntime(364): ... 15 morernrnCaused by 指向context = JAXBContext.newInstance(Report.class);rn这一句。rnrn刚开始工作,遇到的情况。内心有些惶恐!!!!谢谢各位rn
我传参是那里错了?
测试地址是:rnhttp://localhost/user/xiugai.aspx?uid="+id+"rnuid=后面应该是字符串的 但为什么是"+id+"呢 我本想把字符串id付给uid的那里错了呢
一段代码,不知道那里错了,帮忙看看。是vbscript的!
rnrnrn rnrn rn rn 44444444444444444444rnrn rn 555555555555555555555rnrnrnrnrnrn当我点的时候就会提示我 showX的类型不匹配!我也找不到哪里有问题了,大家帮忙看看!
请教两个题,不知道是那里错了。关于继承和抽象类的
1、题1:rnclass ExSuper rn   String name; rn   String nick_name; rn   public ExSuper(String s,String t) rn    name = s;rn    nick_name = t; rn    rn    public String toString() rn     return name; rn     rn    rn   public class Example extends ExSuper rn    public Example(String s,String t) rn    super(s,t); rn     rn    public String toString() rn     return name +"a.k.a"+nick_name;rn     rn    public static void main(String args[])rn     ExSuper a = new ExSuper("First","1st");rn     ExSuper b = new Example("Second","2nd");rn     System.out.println("a is"+a.toString());rn     System.out.println("b is"+b.toString());rn    rn  rnrn答案是:a is Firstrn    b is Secong a.k.a 2ndrn这里是不是这样理解的:对子类的一个实例(ExSuper b = new Example("Second","2nd");),如果子类重写了父类的方法,则运行时系统调用子类的方法,rn 而一个父类的实例ExSuper a = new ExSuper("First","1st");就还是调用父类自己的方法。rnrn我选择的是:运行结果为:rn        a is First a.k.a 1ndrn        b is Second a.k.a 2ndrnrnrn题二:rnabstract class MineBase rn   abstract void amethod(); rn   static int i;rn    rnrn  public class Mine extends MineBasern  rn   public static void main(String argv[])rn    int[] ar = new int[5];rn    for(i = 0;i < ar.length;i++)rn    System.out.println(ar[i]);rn   rn  rn答案:编译出错, Mine应声明为abstract。 rn我选择的是: 打印5个0。rn这个我就看不懂了。rn下面是一些摘抄:rn抽象类rn java语言中,用abstract 关键字来修饰一个类时,这个类叫做抽象类,用abstract 关键字来修饰一个方法时,这个方法叫做抽象方法。格式如下:rn  abstract class abstractClass … //抽象类rn  abstract returnType abstractMethod([paramlist]) //抽象方法rnrn  抽象类必须被继承,抽象方法必须被重写。抽象方法只需声明,无需实现;抽象类不能被实例化,抽象类不一定要包含抽象方法。若类中包含了抽象方法,则该类必须被定义为抽象类。rnrnrn大家能不能告诉我是错在那里啊?rn
Java调用存储过程出错,不知道是那里错了,帮帮忙,谢谢
private CallableStatement cstmt;rnpublic boolean addMemberBook(MemberBook memberbook) throws DBExceptionrn DBManager manager=null;rn String proc="call bookid(?,?,?,?,?,?,?)";rn try rn manager=new DBManager();rn boolean flage=manager.updateProc(proc);rn //这里出错,说是说是空指针异常,实在是搞不明白啊!rn cstmt.setString(1, memberbook.getMemberName());rn cstmt.setString(2, memberbook.getMemberBookID());rn cstmt.setString(3, memberbook.getMemberBookName());rn cstmt.setFloat(4, memberbook.getMemberBookPrice());rn cstmt.setInt(5, memberbook.getMemberBookNumber());rn cstmt.setString(6, memberbook.getMemberBookUnit());rn cstmt.setFloat(7, memberbook.getMemberBookMoney());rn cstmt.execute();rn if (flage==true) rn return true;rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn return false;rnrn
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件