fork(1) download
  1. package com.example.webparser;
  2.  
  3. import android.annotation.SuppressLint;
  4. import android.content.Context;
  5. import android.database.DatabaseErrorHandler;
  6. import android.database.sqlite.SQLiteDatabase;
  7. import android.database.sqlite.SQLiteDatabase.CursorFactory;
  8. import android.database.sqlite.SQLiteOpenHelper;
  9. import android.provider.BaseColumns;
  10. import android.util.Log;
  11.  
  12. public class GSQL extends SQLiteOpenHelper implements BaseColumns {
  13.  
  14. public static GSQL DBHelper = new GSQL((Context)(new Object()) , "GraphSQL.db", null, 1);
  15. public static SQLiteDatabase SDB = DBHelper.getWritableDatabase();
  16.  
  17. private static final String DATABASE_NAME = "GraphSQL.db";
  18. private static final String DATABASE_TABLE = "Graph_Table";
  19. public static final String HOSTNAME = "HostName";
  20. public static final String NAMEONMAP = "NameOnMap";
  21. public static final String MAPNAME = "MapName";
  22. public static final String TYPEOFCHECK = "TypeOfCheck";
  23. public static final String STATE = "State";
  24. public static final String STATUS = "Status";
  25. public static final String RESPONSETIME = "ResponseTime";
  26. public static final String LASTMESSAGE = "LastMessage";
  27.  
  28. @SuppressLint("NewApi")
  29. public GSQL(Context context, String name, CursorFactory factory,
  30. int version, DatabaseErrorHandler errorHandler) {
  31. super(context, name, factory, version, errorHandler);
  32. // TODO Auto-generated constructor stub
  33. }
  34.  
  35. public GSQL(Context context, String name, CursorFactory factory, int version) {
  36. super(context, name, factory, version);
  37. // TODO Auto-generated constructor stub
  38. }
  39.  
  40. private static final String DATABASE_CREATE_SCRIPT = "create table "
  41. + DATABASE_TABLE + " ("
  42. + HOSTNAME + " text not null, "
  43. + NAMEONMAP + " text not null, "
  44. + MAPNAME + " text not null, "
  45. + TYPEOFCHECK + " text not null, "
  46. + STATE + " text not null, "
  47. + STATUS + " integer, "
  48. + RESPONSETIME + " text not null, "
  49. + LASTMESSAGE + " text not null);";
  50.  
  51. @Override
  52. public void onCreate(SQLiteDatabase db) {
  53. // TODO Auto-generated method stub
  54. db.execSQL(DATABASE_CREATE_SCRIPT);
  55. }
  56.  
  57. @Override
  58. public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  59. // TODO Auto-generated method stub
  60.  
  61. Log.w("SQLite", "Updated version " + oldVersion + " on version " + newVersion);
  62.  
  63.  
  64. db.execSQL("DROP TABLE IF IT EXIST " + DATABASE_TABLE);
  65.  
  66. onCreate(db);
  67.  
  68. }
  69.  
  70. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: class GSQL is public, should be declared in a file named GSQL.java
public class GSQL extends SQLiteOpenHelper implements BaseColumns {
       ^
Main.java:3: error: package android.annotation does not exist
import android.annotation.SuppressLint;
                         ^
Main.java:4: error: package android.content does not exist
import android.content.Context;
                      ^
Main.java:5: error: package android.database does not exist
import android.database.DatabaseErrorHandler;
                       ^
Main.java:6: error: package android.database.sqlite does not exist
import android.database.sqlite.SQLiteDatabase;
                              ^
Main.java:7: error: package android.database.sqlite.SQLiteDatabase does not exist
import android.database.sqlite.SQLiteDatabase.CursorFactory;
                                             ^
Main.java:8: error: package android.database.sqlite does not exist
import android.database.sqlite.SQLiteOpenHelper;
                              ^
Main.java:9: error: package android.provider does not exist
import android.provider.BaseColumns;
                       ^
Main.java:10: error: package android.util does not exist
import android.util.Log;
                   ^
Main.java:12: error: cannot find symbol
public class GSQL extends SQLiteOpenHelper implements BaseColumns {
                          ^
  symbol: class SQLiteOpenHelper
Main.java:12: error: cannot find symbol
public class GSQL extends SQLiteOpenHelper implements BaseColumns {
                                                      ^
  symbol: class BaseColumns
Main.java:15: error: cannot find symbol
	public static SQLiteDatabase SDB = DBHelper.getWritableDatabase();
	              ^
  symbol:   class SQLiteDatabase
  location: class GSQL
Main.java:29: error: cannot find symbol
	public GSQL(Context context, String name, CursorFactory factory,
	            ^
  symbol:   class Context
  location: class GSQL
Main.java:29: error: cannot find symbol
	public GSQL(Context context, String name, CursorFactory factory,
	                                          ^
  symbol:   class CursorFactory
  location: class GSQL
Main.java:30: error: cannot find symbol
			int version, DatabaseErrorHandler errorHandler) {
			             ^
  symbol:   class DatabaseErrorHandler
  location: class GSQL
Main.java:35: error: cannot find symbol
	public GSQL(Context context, String name, CursorFactory factory, int version) {
	            ^
  symbol:   class Context
  location: class GSQL
Main.java:35: error: cannot find symbol
	public GSQL(Context context, String name, CursorFactory factory, int version) {
	                                          ^
  symbol:   class CursorFactory
  location: class GSQL
Main.java:52: error: cannot find symbol
	public void onCreate(SQLiteDatabase db) {
	                     ^
  symbol:   class SQLiteDatabase
  location: class GSQL
Main.java:58: error: cannot find symbol
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	                      ^
  symbol:   class SQLiteDatabase
  location: class GSQL
Main.java:28: error: cannot find symbol
	@SuppressLint("NewApi")
	 ^
  symbol:   class SuppressLint
  location: class GSQL
Main.java:14: error: cannot find symbol
	public static GSQL DBHelper = new GSQL((Context)(new Object()) , "GraphSQL.db", null, 1);
	                                        ^
  symbol:   class Context
  location: class GSQL
Main.java:15: error: cannot find symbol
	public static SQLiteDatabase SDB = DBHelper.getWritableDatabase();
	                                           ^
  symbol:   method getWritableDatabase()
  location: variable DBHelper of type GSQL
Main.java:51: error: method does not override or implement a method from a supertype
	@Override
	^
Main.java:61: error: cannot find symbol
		Log.w("SQLite", "Updated version " + oldVersion + " on version " + newVersion);
		^
  symbol:   variable Log
  location: class GSQL
Main.java:57: error: method does not override or implement a method from a supertype
	@Override
	^
25 errors
stdout
Standard output is empty